Sha256: a18d4299bf79a4f528557f22064abb6ca64bc1892e8512f8c8f4b0b8dbbd64b3

Contents?: true

Size: 831 Bytes

Versions: 28

Compression:

Stored size: 831 Bytes

Contents

require 'test_helper'

module Workarea
  module Search
    class StorefrontSearch
      class ResponseTest < TestCase
        def test_only_uses_active_product_rules
          customization = create_search_customization(
            id: 'foo',
            product_rules: [
              { name: 'excluded_products', operator: 'equals', value: '1' },
              { name: 'excluded_products', operator: 'equals', value: '2', active: false }
            ]
          )

          response = Response.new(q: 'foo', customization: customization)
          assert_equal(customization.product_rules.take(1), response.query.params[:rules])

          customization.product_rules.first.update!(active: false)
          response.reset!(q: 'foo')
          assert_empty(response.query.params[:rules])
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.26 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.25 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.23 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.22 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.21 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.20 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.19 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.18 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.17 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.16 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.15 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.14 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.13 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.12 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.11 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.10 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.9 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.8 test/queries/workarea/search/storefront_search/response_test.rb
workarea-core-3.5.7 test/queries/workarea/search/storefront_search/response_test.rb