Sha256: 415c6cf34ea6ed0cab1f6494c3cb4aa1a298ceda6e5ea706859d8561d4a6280e
Contents?: true
Size: 1.02 KB
Versions: 16
Compression:
Stored size: 1.02 KB
Contents
require 'test_helper' module Workarea module Api module Storefront class TaxonsIntegrationTest < IntegrationTest setup :set_taxons def set_taxons @taxon = create_taxon( name: 'Mens', url: 'http://example.com/pages/mens' ) @taxon.children.create!(name: 'Sale') end def test_show get storefront_api.taxon_path(@taxon) result = JSON.parse(response.body) assert_equal(@taxon.id.to_s, result['taxon']['id']) assert_equal( 'http://example.com/pages/mens', result['taxon']['navigable_url'] ) assert_equal(1, result['children'].size) end def test_inactive_taxon @taxon.update_attributes!( url: nil, navigable: create_page(active: false) ) get storefront_api.taxon_path(@taxon) refute(response.ok?) assert_equal(404, response.status) end end end end end
Version data entries
16 entries across 16 versions & 2 rubygems