spec/scoping_permissions_spec.rb in permissive-0.2.8.alpha vs spec/scoping_permissions_spec.rb in permissive-0.2.9.alpha
- old
+ new
@@ -70,13 +70,18 @@
@user.can?(:punch, :on => user).should be_true
end
end
describe "on classes" do
- it "should ignore instance-specific permissions" do
+ it "should trump instance-specific permissions" do
@user.can!(:punch, :on => Permissive::User)
@user.can?(:punch, :on => Permissive::User).should be_true
- @user.can?(:punch, :on => Permissive::User.create).should be_false
+ @user.can?(:punch, :on => Permissive::User.create).should be_true
+ end
+
+ it "should not be trumped by instances" do
+ @user.can!(:punch, :on => Permissive::User.create)
+ @user.can?(:punch, :on => Permissive::User).should be_false
end
it "should interpolate symbols" do
@user.can!(:punch, :on => :users)
@user.can?(:punch, :on => Permissive::User).should be_true
\ No newline at end of file