0
0
Fork 0

Serializers spec coverage (#24017)

This commit is contained in:
Matt Jankowski 2023-03-10 06:12:51 -05:00 committed by GitHub
parent 53309fa31a
commit 56bddfbfa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 217 additions and 0 deletions

View file

@ -0,0 +1,26 @@
# frozen_string_literal: true
require 'rails_helper'
describe REST::SuggestionSerializer do
let(:serialization) do
JSON.parse(
ActiveModelSerializers::SerializableResource.new(
record, serializer: described_class
).to_json
)
end
let(:record) do
AccountSuggestions::Suggestion.new(
account: account,
source: 'SuggestionSource'
)
end
let(:account) { Fabricate(:account) }
describe 'account' do
it 'returns the associated account' do
expect(serialization['account']['id']).to eq(account.id.to_s)
end
end
end