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

Changes rules order in mongoid specs. Fixes #672 #673

Merged
merged 1 commit into from Feb 22, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions spec/cancan/model_adapters/mongoid_adapter_spec.rb
Expand Up @@ -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
Expand Down