mirror of
https://github.com/discourse/discourse.git
synced 2024-12-30 07:33:50 +08:00
18 lines
502 B
Ruby
18 lines
502 B
Ruby
|
# frozen_string_literal: true
|
||
|
RSpec.describe UserWithCustomFieldsSerializer do
|
||
|
describe "#status" do
|
||
|
fab!(:user_status)
|
||
|
fab!(:user) { Fabricate(:user, user_status: user_status) }
|
||
|
|
||
|
it "adds user status when enabled in site settings" do
|
||
|
SiteSetting.enable_user_status = true
|
||
|
|
||
|
serializer =
|
||
|
described_class.new(user, scope: Guardian.new(user), root: false, include_status: true)
|
||
|
json = serializer.as_json
|
||
|
|
||
|
expect(json[:status]).to be_present
|
||
|
end
|
||
|
end
|
||
|
end
|