mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:23:37 +08:00
a2e6a8a51e
The other assertion is already asserting for `Post#url` and I think it makes the test clearer here.
17 lines
491 B
Ruby
17 lines
491 B
Ruby
require 'rails_helper'
|
|
|
|
describe ReviewableFlaggedPostSerializer do
|
|
|
|
let(:admin) { Fabricate(:admin) }
|
|
|
|
it "includes the user fields for review" 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 eq(p0.cooked)
|
|
expect(json[:raw]).to eq(p0.raw)
|
|
expect(json[:topic_url]).to eq(p0.url)
|
|
end
|
|
|
|
end
|