Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added spec for role=

  • Loading branch information...
commit 8ff08b8e0be64e6a37b13737647cd56abf2e596d 1 parent b1672b8
@kristianmandrup authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/roles_generic/rspec/api/write_api.rb
View
12 lib/roles_generic/rspec/api/write_api.rb
@@ -13,6 +13,18 @@ class Role
@guest_user.roles = :guest
end
end
+
+ describe '#role=' do
+ it "should set user role to :admin" do
+ @guest_user.role = :admin
+ @guest_user.has_role?(:admin).should be_true
+ @guest_user.role = :guest
+
+ u = User.new 'Test user'
+ u.role = :admin
+ u.has_role?(:admin).should be_true
+ end
+ end
describe '#exchange_roles' do
it "should exchange user role :user with role :admin" do
Please sign in to comment.
Something went wrong with that request. Please try again.