Update specs for MongoidAdditions to use rr mocks

This commit is contained in:
Mani Tadayon
2010-11-16 15:47:07 -08:00
parent f6aaa581ef
commit 5ebca1f9bf
2 changed files with 3 additions and 5 deletions

View File

@@ -97,8 +97,8 @@ describe CanCan::MongoidAdditions do
describe "activates only when there are Criteria in the hash" do
it "Calls where on the model class when there are criteria" do
obj = @model_class.create :title => 'Bird'
@conditions = {:title.nin => ["Fork", "Spoon"]}
@model_class.should_receive(:where).with(@conditions) {[obj]}
@conditions = {:title.nin => ["Fork", "Spoon"]}
mock(@model_class).where(@conditions) {[obj]}
@ability.can :read, @model_class, @conditions
@ability.can?(:read, obj)
end