fixing model comparison spec, I believe this bug is caused by recent version of with_model

This commit is contained in:
Ryan Bates 2011-09-28 10:08:21 -07:00
parent b8ff2dbc6a
commit 6ef2c44f57

View File

@ -131,8 +131,9 @@ if ENV["MODEL_ADAPTER"].nil? || ENV["MODEL_ADAPTER"] == "active_record"
category2 = Category.create!(:visible => true)
article1 = Article.create!(:secret => true, :category => category1)
article2 = Article.create!(:secret => true, :category => category2)
category1.articles.accessible_by(@ability).should == [article1]
end
# for some reason the objects aren't comparing equally here so it's necessary to compare by id
category1.articles.accessible_by(@ability).map(&:id).should == [article1.id]
end
it "should raise an exception when trying to merge scope with other conditions" do
@ability.can :read, :articles, :published => true