Sha256: 445072202ef0a78a2469afa0e9172ad8551d67faa3c59252f49e6942243d055b

Contents?: true

Size: 593 Bytes

Versions: 8

Compression:

Stored size: 593 Bytes

Contents

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

  its(:to_json) do
    is_expected.to be_json_eql <<-JSON
      {
        "data" : {
          "attributes" : {
            "abbr" : "#{state.abbr}",
            "name" : "#{state.name}"
          },
          "relationships" : {
            "country" : {
              "data" : {
                "type" : "spree_countries"
              }
            }
          },
          "type" : "spree_states"
        }
      }
    JSON
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

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