Sha256: e63adf814a9b0a2e0c2ccfa441de567a43e9b4859a23ff115e26e7de1b398f28

Contents?: true

Size: 739 Bytes

Versions: 8

Compression:

Stored size: 739 Bytes

Contents

describe Spree::CountrySerializer do
  let(:country) { create :country }
  subject { ActiveModel::Serializer::Adapter::JsonApi.new(described_class.new country) }

  its(:to_json) do
    is_expected.to be_json_eql <<-JSON
      {
        "data" : {
          "attributes" : {
            "iso" : "#{country.iso}",
            "iso3" : "#{country.iso3}",
            "iso_name" : "#{country.iso_name}",
            "name" : "#{country.name}",
            "numcode" : #{country.numcode},
            "states_required" : #{country.states_required}
          },
          "relationships" : {
            "states" : {
              "data" : []
            }
          },
          "type" : "spree_countries"
        }
      }
    JSON
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
solidus_json_api-0.3.1 spec/serializers/spree/country_serializer_spec.rb
solidus_json_api-0.3.0 spec/serializers/spree/country_serializer_spec.rb
spree_api_v2-0.2.2 spec/serializers/spree/country_serializer_spec.rb
solidus_api_v2-0.2.2 spec/serializers/spree/country_serializer_spec.rb
solidus_api_v2-0.2.1 spec/serializers/spree/country_serializer_spec.rb
spree_api_v2-0.2.1 spec/serializers/spree/country_serializer_spec.rb
spree_api_v2-0.2.0 spec/serializers/spree/country_serializer_spec.rb
solidus_api_v2-0.2.0 spec/serializers/spree/country_serializer_spec.rb