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,20 @@
# frozen_string_literal: true
require 'rails_helper'
describe REST::Keys::QueryResultSerializer do
let(:serialization) do
JSON.parse(
ActiveModelSerializers::SerializableResource.new(
record, serializer: described_class
).to_json
)
end
let(:record) { Keys::QueryService::Result.new(Account.new(id: 123), []) }
describe 'account' do
it 'returns the associated account id' do
expect(serialization['account_id']).to eq('123')
end
end
end