Sha256: d337c00a3bf9fe512f4dcaae3d7b8ab53ba5cba61d77ce096bf880d263e8427c

Contents?: true

Size: 1.21 KB

Versions: 8

Compression:

Stored size: 1.21 KB

Contents

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

  its(:to_json) do
    is_expected.to be_json_eql <<-JSON
      {
        "data" : {
          "attributes" : {
            "depth" : 0,
            "description" : null,
            "links": {
              "large" : "/assets/default_taxon.png",
              "mini" : "/assets/default_taxon.png",
              "original" : "/assets/default_taxon.png",
              "product" : "/assets/default_taxon.png",
              "small" : "/assets/default_taxon.png"
            },
            "meta_description" : null,
            "meta_keywords" : null,
            "meta_title" : null,
            "name" : "#{taxon.name}",
            "permalink" : "#{taxon.permalink}",
            "position" : 0
          },
          "relationships" : {
            "children" : {
              "data" : []
            },
            "parent" : {
              "data" : null
            },
            "taxonomy" : {
              "data" : {
                "type" : "spree_taxonomies"
              }
            }
          },
          "type" : "spree_taxons"
        }
      }
    JSON
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

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