Add submission deadline to exercises and allow teachers to view their submissions

This commit is contained in:
Sebastian Serth
2020-05-07 17:45:53 +02:00
parent 4c571c4fb2
commit 914eeb6035
21 changed files with 456 additions and 245 deletions

View File

@ -3,7 +3,7 @@ require 'rails_helper'
describe ExternalUserPolicy do
subject { described_class }
[:create?, :destroy?, :edit?, :index?, :new?, :show?, :update?].each do |action|
[:create?, :destroy?, :edit?, :new?, :show?, :update?].each do |action|
permissions(action) do
it 'grants access to admins only' do
expect(subject).to permit(FactoryBot.build(:admin), ExternalUser.new)
@ -13,4 +13,16 @@ describe ExternalUserPolicy do
end
end
end
[:index?].each do |action|
permissions(action) do
it 'grants access to admins and teachers only' do
expect(subject).to permit(FactoryBot.build(:admin), ExternalUser.new)
expect(subject).to permit(FactoryBot.build(:teacher), ExternalUser.new)
[:external_user].each do |factory_name|
expect(subject).not_to permit(FactoryBot.build(factory_name), ExternalUser.new)
end
end
end
end
end