mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 12:23:46 +08:00
22 lines
537 B
Ruby
22 lines
537 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe WebHookUserSerializer do
|
|
let(:user) do
|
|
user = Fabricate(:user)
|
|
SingleSignOnRecord.create!(user_id: user.id, external_id: '12345', last_payload: '')
|
|
user
|
|
end
|
|
|
|
let(:admin) { Fabricate(:admin) }
|
|
|
|
let :serializer do
|
|
WebHookUserSerializer.new(user, scope: Guardian.new(admin), root: false)
|
|
end
|
|
|
|
it "should include relevant user info" do
|
|
payload = serializer.as_json
|
|
expect(payload[:email]).to eq(user.email)
|
|
expect(payload[:external_id]).to eq('12345')
|
|
end
|
|
end
|