Skip to content

Commit dce64da

Browse files
committed
Add basic spec coverage for User#admin?
Strictly speaking this doesn't test that the current implementation returns `true` if the user has the "editor-admin" role for *any* organisation. However, that's already a bit of a bodge until we decide whether we want to properly support non-organisation-specific roles, so I think this is fine for now.
1 parent 94d3aef commit dce64da

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/models/user_spec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,12 @@
211211
include_examples 'role_check', 'school-student'
212212
end
213213

214+
describe '#admin?' do
215+
subject { user.admin? }
216+
217+
include_examples 'role_check', 'editor-admin'
218+
end
219+
214220
describe '.where' do
215221
subject(:user) { described_class.where(id: '00000000-0000-0000-0000-000000000000').first }
216222

0 commit comments

Comments
 (0)