Rename Mongoid collection used in spec and fix description for first spec

This commit is contained in:
Mani Tadayon 2010-12-26 01:37:29 -08:00
parent 4339ac6546
commit ebb8e1bf8b

View File

@ -34,7 +34,7 @@ class MongoidProject
end end
Mongoid.configure do |config| Mongoid.configure do |config|
config.master = Mongo::Connection.new('127.0.0.1', 27017).db("workflow_on_mongoid") config.master = Mongo::Connection.new('127.0.0.1', 27017).db("cancan_mongoid_additions_spec")
end end
describe CanCan::MongoidAdditions do describe CanCan::MongoidAdditions do
@ -50,7 +50,7 @@ describe CanCan::MongoidAdditions do
end.each(&:drop) end.each(&:drop)
end end
it "should compare properties on mongoid documents with the " do it "should compare properties on mongoid documents with the conditions hash" do
model = @model_class.new model = @model_class.new
@ability.can :read, @model_class, :id => model.id @ability.can :read, @model_class, :id => model.id
@ability.should be_able_to :read, model @ability.should be_able_to :read, model
@ -100,7 +100,7 @@ describe CanCan::MongoidAdditions do
@conditions = {:title.nin => ["Fork", "Spoon"]} @conditions = {:title.nin => ["Fork", "Spoon"]}
mock(@model_class).where(@conditions) {[obj]} mock(@model_class).where(@conditions) {[obj]}
@ability.can :read, @model_class, @conditions @ability.can :read, @model_class, @conditions
@ability.can?(:read, obj) @ability.should be_able_to(:read, obj)
end end
it "Calls the base version if there are no mongoid criteria" do it "Calls the base version if there are no mongoid criteria" do
obj = @model_class.new :title => 'Bird' obj = @model_class.new :title => 'Bird'