Sha256: 3f5ded43daa3ca80545c552d764f6516eff2bcdc97336f31894cbd4f71e2d0a7
Contents?: true
Size: 1.17 KB
Versions: 1
Compression:
Stored size: 1.17 KB
Contents
describe Hydra::RoleManagement::UserRoles do let(:librarian) { Role.create!(name: 'librarian') } describe "a real user" do subject do User.create!(email: 'fred@example.com', password: 'password') end it "should have admin?" do expect(subject).not_to be_admin end describe "with roles" do before do subject.roles << librarian end its(:roles) { should eq [librarian] } its(:groups) { should include('registered', 'librarian') } end end describe "when DeviseGuests is installed" do before do stub_const("DeviseGuests", true) end describe "a real user" do subject do User.create!(email: 'fred@example.com', password: 'password') end it { should_not be_admin } describe "with roles" do before do subject.roles << librarian end its(:groups) { should include('registered', 'librarian') } end end describe "a guest user" do subject do User.create!(email: 'fred@example.com', password: 'password', guest: true) end it { should_not be_admin } its(:groups) { should be_empty } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hydra-role-management-1.0.0 | spec/lib/user_roles_spec.rb |