suggestion_serializer_spec.rb 498 B

1234567891011121314151617181920
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe REST::SuggestionSerializer do
  4. let(:serialization) { serialized_record_json(record, described_class) }
  5. let(:record) do
  6. AccountSuggestions::Suggestion.new(
  7. account: account,
  8. sources: ['SuggestionSource']
  9. )
  10. end
  11. let(:account) { Fabricate(:account) }
  12. describe 'account' do
  13. it 'returns the associated account' do
  14. expect(serialization['account']['id']).to eq(account.id.to_s)
  15. end
  16. end
  17. end