DEV: Refactor test to assert for actual content.

The other assertion is already asserting for `Post#url` and I think it
makes the test clearer here.
This commit is contained in:
Guo Xiang Tan 2019-04-02 07:43:13 +08:00
parent aa2311a7b0
commit a2e6a8a51e
1 changed files with 2 additions and 2 deletions

View File

@ -8,8 +8,8 @@ describe ReviewableFlaggedPostSerializer do
p0 = Fabricate(:post)
reviewable = PostActionCreator.spam(Fabricate(:user), p0).reviewable
json = ReviewableFlaggedPostSerializer.new(reviewable, scope: Guardian.new(admin), root: nil).as_json
expect(json[:cooked]).to be_present
expect(json[:raw]).to be_present
expect(json[:cooked]).to eq(p0.cooked)
expect(json[:raw]).to eq(p0.raw)
expect(json[:topic_url]).to eq(p0.url)
end