Sha256: c3a26dce639241db53e32a2f8d669c2c0984eec02f873010cb638503393aba7c

Contents?: true

Size: 783 Bytes

Versions: 8

Compression:

Stored size: 783 Bytes

Contents

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

  its(:to_json) do
    is_expected.to be_json_eql <<-JSON
      {
        "data" : {
          "attributes" : {
            "name" : "#{option_value.name}",
            "position" : #{option_value.position},
            "presentation" : "#{option_value.presentation}"
          },
          "relationships" : {
            "option_type" : {
              "data" : {
                "type" : "spree_option_types"
              }
            },
            "variants" : {
              "data" : []
            }
          },
          "type" : "spree_option_values"
        }
      }
    JSON
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

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