Skip to content
Browse files

Merge pull request #673 from juggler/rules_order

Changes rules order in mongoid specs. Fixes #672
2 parents 68ea78b + 17043ca commit e6bf4c8d12dca316eb4f0923ca30b6d3dfedb7ae @ryanb committed Feb 21, 2013
Showing with 2 additions and 3 deletions.
  1. +2 −3 spec/cancan/model_adapters/mongoid_adapter_spec.rb
View
5 spec/cancan/model_adapters/mongoid_adapter_spec.rb
@@ -83,14 +83,13 @@ class MongoidProject
MongoidProject.accessible_by(@ability, :destroy).entries.should == [sir]
end
- it "is able to mix empty conditions and hashes" do
- pending "TODO figure out why this isn't working"
+ it "takes presedence over rule defined without a condition" do
@ability.can :read, :mongoid_projects
@ability.can :read, :mongoid_projects, :title => 'Sir'
sir = MongoidProject.create(:title => 'Sir')
lord = MongoidProject.create(:title => 'Lord')
- MongoidProject.accessible_by(@ability, :read).count.should == 2
+ MongoidProject.accessible_by(@ability, :read).entries.should == [sir]
end
it "returns everything when the defined ability is access all" do

0 comments on commit e6bf4c8

Please sign in to comment.
Something went wrong with that request. Please try again.