Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #673 from juggler/rules_order
Browse files Browse the repository at this point in the history
Changes rules order in mongoid specs. Fixes #672
  • Loading branch information
ryanb committed Feb 22, 2013
2 parents 68ea78b + 17043ca commit e6bf4c8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spec/cancan/model_adapters/mongoid_adapter_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -83,14 +83,13 @@ class MongoidProject
MongoidProject.accessible_by(@ability, :destroy).entries.should == [sir] MongoidProject.accessible_by(@ability, :destroy).entries.should == [sir]
end end


it "is able to mix empty conditions and hashes" do it "takes presedence over rule defined without a condition" do
pending "TODO figure out why this isn't working"
@ability.can :read, :mongoid_projects @ability.can :read, :mongoid_projects
@ability.can :read, :mongoid_projects, :title => 'Sir' @ability.can :read, :mongoid_projects, :title => 'Sir'
sir = MongoidProject.create(:title => 'Sir') sir = MongoidProject.create(:title => 'Sir')
lord = MongoidProject.create(:title => 'Lord') lord = MongoidProject.create(:title => 'Lord')


MongoidProject.accessible_by(@ability, :read).count.should == 2 MongoidProject.accessible_by(@ability, :read).entries.should == [sir]
end end


it "returns everything when the defined ability is access all" do it "returns everything when the defined ability is access all" do
Expand Down

0 comments on commit e6bf4c8

Please sign in to comment.