Use Mongoid::Matchers#matches? instead of a database query in MongoidAdapter#matches_conditions_hash?
This commit is contained in:
@@ -84,7 +84,7 @@ if ENV["MODEL_ADAPTER"] == "mongoid"
|
||||
it "Calls where on the model class when there are criteria" do
|
||||
obj = MongoidProject.create(:title => 'Bird')
|
||||
@conditions = {:title.nin => ["Fork", "Spoon"]}
|
||||
mock(MongoidProject).where(@conditions) {[obj]}
|
||||
|
||||
@ability.can :read, MongoidProject, @conditions
|
||||
@ability.should be_able_to(:read, obj)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user