Sha256: 0320796c1882dd5f6b9cf5f9d8ef639d4e3210921d39dffb06742c5382f619bd

Contents?: true

Size: 655 Bytes

Versions: 8

Compression:

Stored size: 655 Bytes

Contents

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

  its(:to_json) do
    is_expected.to be_json_eql <<-JSON
      {
        "data" : {
          "attributes" : {
            "name" : "#{taxonomy.name}",
            "position" : #{taxonomy.position}
          },
          "relationships" : {
            "taxons" : {
              "data" : [
                {
                  "type" : "spree_taxons"
                }
              ]
            }
          },
          "type" : "spree_taxonomies"
        }
      }
    JSON
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

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