mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 00:25:23 +08:00
18 lines
431 B
Ruby
18 lines
431 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
require 'rails_helper'
|
||
|
|
||
|
describe NotificationSerializer do
|
||
|
describe '#as_json' do
|
||
|
fab!(:user) { Fabricate(:user) }
|
||
|
let(:notification) { Fabricate(:notification, user: user) }
|
||
|
let(:serializer) { NotificationSerializer.new(notification) }
|
||
|
let(:json) { serializer.as_json }
|
||
|
|
||
|
it "returns the user_id" do
|
||
|
expect(json[:notification][:user_id]).to eq(user.id)
|
||
|
end
|
||
|
|
||
|
end
|
||
|
end
|