claim_result_serializer_spec.rb 488 B

1234567891011121314151617181920
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe REST::Keys::ClaimResultSerializer do
  4. let(:serialization) do
  5. JSON.parse(
  6. ActiveModelSerializers::SerializableResource.new(
  7. record, serializer: described_class
  8. ).to_json
  9. )
  10. end
  11. let(:record) { Keys::ClaimService::Result.new(Account.new(id: 123), 456) }
  12. describe 'account' do
  13. it 'returns the associated account' do
  14. expect(serialization['account_id']).to eq('123')
  15. end
  16. end
  17. end