fixing model comparison spec, I believe this bug is caused by recent version of with_model
This commit is contained in:
parent
b8ff2dbc6a
commit
6ef2c44f57
|
@ -131,8 +131,9 @@ if ENV["MODEL_ADAPTER"].nil? || ENV["MODEL_ADAPTER"] == "active_record"
|
||||||
category2 = Category.create!(:visible => true)
|
category2 = Category.create!(:visible => true)
|
||||||
article1 = Article.create!(:secret => true, :category => category1)
|
article1 = Article.create!(:secret => true, :category => category1)
|
||||||
article2 = Article.create!(:secret => true, :category => category2)
|
article2 = Article.create!(:secret => true, :category => category2)
|
||||||
category1.articles.accessible_by(@ability).should == [article1]
|
# for some reason the objects aren't comparing equally here so it's necessary to compare by id
|
||||||
end
|
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
|
it "should raise an exception when trying to merge scope with other conditions" do
|
||||||
@ability.can :read, :articles, :published => true
|
@ability.can :read, :articles, :published => true
|
||||||
|
|
Loading…
Reference in New Issue
Block a user