discourse/spec/serializers/notification_serializer_spe...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
431 B
Ruby
Raw Normal View History

# 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