mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 18:36:35 +08:00
b58867b6e9
Includes support for flags, reviewable users and queued posts, with REST API backwards compatibility. Co-Authored-By: romanrizzi <romanalejandro@gmail.com> Co-Authored-By: jjaffeux <j.jaffeux@gmail.com>
17 lines
528 B
Ruby
17 lines
528 B
Ruby
require 'rails_helper'
|
|
|
|
describe ReviewableUserSerializer do
|
|
|
|
let(:reviewable) { Fabricate(:reviewable) }
|
|
let(:admin) { Fabricate(:admin) }
|
|
|
|
it "includes the user fields for review" do
|
|
json = ReviewableUserSerializer.new(reviewable, scope: Guardian.new(admin), root: nil).as_json
|
|
expect(json[:user_id]).to eq(reviewable.target_id)
|
|
expect(json[:username]).to eq(reviewable.target.username)
|
|
expect(json[:email]).to eq(reviewable.target.email)
|
|
expect(json[:name]).to eq(reviewable.target.name)
|
|
end
|
|
|
|
end
|