FIX: Take action should agree with all pending flags

This commit is contained in:
Robin Ward
2019-04-08 12:39:18 -04:00
parent 0fc798c2ef
commit df1ab9259b
2 changed files with 25 additions and 6 deletions

View File

@ -101,4 +101,23 @@ describe PostActionCreator do
end
end
end
context "take_action" do
before do
PostActionCreator.create(Fabricate(:user), post, :inappropriate)
end
it "will agree with the old reviewable" do
reviewable = PostActionCreator.new(
Fabricate(:moderator),
post,
PostActionType.types[:spam],
take_action: true
).perform.reviewable
scores = reviewable.reviewable_scores
expect(scores[0]).to be_agreed
expect(scores[1]).to be_agreed
expect(reviewable.reload).to be_approved
end
end
end