You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
584 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe REST::SuggestionSerializer 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) do
  12. AccountSuggestions::Suggestion.new(
  13. account: account,
  14. source: 'SuggestionSource'
  15. )
  16. end
  17. let(:account) { Fabricate(:account) }
  18. describe 'account' do
  19. it 'returns the associated account' do
  20. expect(serialization['account']['id']).to eq(account.id.to_s)
  21. end
  22. end
  23. end