Redefine user roles with their role in a study group
This commit is contained in:

committed by
Sebastian Serth

parent
04ed45ea73
commit
9c9f45ff77
@ -36,4 +36,10 @@ describe ExternalUser do
|
||||
expect(build(:external_user).teacher?).to be false
|
||||
end
|
||||
end
|
||||
|
||||
describe 'external_user has no current_study_group_id' do
|
||||
it 'defaults to being a learner' do
|
||||
expect(build(:external_user).learner?).to be true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -63,13 +63,9 @@ describe InternalUser do
|
||||
end
|
||||
end
|
||||
|
||||
it 'validates the domain of the role' do
|
||||
user.update(role: 'Foo')
|
||||
expect(user.errors[:role]).to be_present
|
||||
end
|
||||
|
||||
it 'validates the presence of a role' do
|
||||
expect(user.errors[:role]).to be_present
|
||||
it 'validates the presence of the platform_admin flag' do
|
||||
user.update(platform_admin: nil)
|
||||
expect(user.errors[:platform_admin]).to be_present
|
||||
end
|
||||
|
||||
describe '#admin?' do
|
||||
|
Reference in New Issue
Block a user