Improved public_for_api scopes and corresponding specs
This commit is contained in:
@@ -134,7 +134,7 @@ describe Comment do
|
||||
end
|
||||
end
|
||||
|
||||
describe "public_for_api" do
|
||||
describe "public_for_api scope" do
|
||||
it "returns comments" do
|
||||
comment = create(:comment)
|
||||
|
||||
@@ -174,5 +174,12 @@ describe Comment do
|
||||
|
||||
expect(Comment.public_for_api).not_to include(comment)
|
||||
end
|
||||
|
||||
it 'does not return comments on budget investments' do
|
||||
budget_investment = create(:budget_investment)
|
||||
comment = create(:comment, commentable: budget_investment)
|
||||
|
||||
expect(Comment.public_for_api).not_to include(comment)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user