Sha256: cfbbbedc9cb1504f775657471bdaa7afa74891f648855f8c292939ad0d560299

Contents?: true

Size: 1021 Bytes

Versions: 31

Compression:

Stored size: 1021 Bytes

Contents

require 'test_helper'

module Workarea
  module Storefront
    class CategoriesIntegrationTest < Workarea::IntegrationTest
      def test_does_not_show_inactive_category
        assert_raise InvalidDisplay do
          get storefront.category_path(create_category(active: false))
          assert(response.not_found?)
        end
      end

      def test_allows_showing_an_inactive_category_when_admin_user
        set_current_user(create_user(admin: true))

        get storefront.category_path(create_category(active: false))
        assert(response.ok?)
      end

      def test_not_accepting_per_page_param
        products = [create_product, create_product]
        category = create_category(product_ids: products.map(&:id))

        get storefront.category_path(category, page: 1, per_page: 1)
        assert(response.ok?)
        assert_includes(response.body, storefront.product_path(products.first))
        assert_includes(response.body, storefront.product_path(products.second))
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
workarea-storefront-3.5.27 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.5.26 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.4.45 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.5.25 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.5.23 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.4.44 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.5.22 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.4.43 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.5.21 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.4.42 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.5.20 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.4.41 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.5.19 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.4.40 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.5.18 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.4.39 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.5.17 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.4.38 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.5.16 test/integration/workarea/storefront/categories_integration_test.rb
workarea-storefront-3.4.37 test/integration/workarea/storefront/categories_integration_test.rb