workarea-core 3.4.14 → 3.4.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59160e157cffc857bc65efe72271a504139f2e41b2c429be72a3652ac39c440c
4
- data.tar.gz: 65d2fb401db6c46f61b2c71898d3b7a1a006265b179aa88bb5fe8a5080ec81b2
3
+ metadata.gz: ca7289a6b90924018068c1ab8f800600ed3c714d63a08cf95217224efc8f069c
4
+ data.tar.gz: 23a4f30485bb3d230669213d5f7acd258a605865ea0f1a94da9ce4321d941224
5
5
  SHA512:
6
- metadata.gz: 1fc9a6ff3a20fdb2190358643b9257dfc8583d80e4d98159f82b0b176966c3d2211a4dd0273b33346d2a9cd41c2f956dff51fcc9a7b7994a3d30694b5575be63
7
- data.tar.gz: c0639d0f522f6014e43745b3f2ff1f9da027367af2ac80a814bebba73f3a39680ee99bcdaf87369d8a8eeae0150b346615889263baacccd2c8dad4bfa80dd494
6
+ metadata.gz: ac75f323f12f1e4ebfdf965edc82524219daa425fcf3fe90999e2ffc173ff18ec987616df95527328f0d568a7471fe570053ce1c73c511c3bce08202a076c8ad
7
+ data.tar.gz: f4dd55dd0a19e1d3db07e6e181c5a349ec19ee40b5c91026b1286bb09419ecb2d9c4e80d9169d0975cef1f5efc22d38f81db358d2f6cd15df5820baeb2ccfa49
@@ -7,7 +7,7 @@ module Workarea
7
7
  def call(response)
8
8
  exact_match = find_exact_match(response)
9
9
 
10
- if !response.has_filters? && exact_match.present?
10
+ if response.customization.new_record? && !response.has_filters? && exact_match.present?
11
11
  response.redirect = product_path(exact_match)
12
12
  else
13
13
  yield
@@ -44,7 +44,7 @@ module Workarea
44
44
 
45
45
  def password
46
46
  if Rails.env.development?
47
- 'W3bl1nc!'
47
+ 'w0rkArea!'
48
48
  else
49
49
  "#{SecureRandom.hex(10)}_aA1"
50
50
  end
@@ -53,6 +53,10 @@ module Workarea
53
53
  super || @source.respond_to?(method_name)
54
54
  end
55
55
 
56
+ def deep_dup
57
+ self.class.new(@source.deep_dup)
58
+ end
59
+
56
60
  private
57
61
 
58
62
  def assert_index(index, where)
@@ -2,7 +2,7 @@ module Workarea
2
2
  module VERSION
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 14
5
+ PATCH = 15
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
@@ -41,5 +41,16 @@ module Workarea
41
41
  assert_instance_of(SwappableList, @list)
42
42
  refute_includes(@list, :three)
43
43
  end
44
+
45
+ def test_deep_dup
46
+ config_1 = ActiveSupport::OrderedOptions.new
47
+ config_1.list = SwappableList.new([:foo])
48
+ config_2 = config_1.deep_dup
49
+
50
+ config_2.list.swap(:foo, :bar)
51
+
52
+ assert_equal([:foo], config_1.list.to_a)
53
+ assert_equal([:bar], config_2.list.to_a)
54
+ end
44
55
  end
45
56
  end
@@ -106,6 +106,21 @@ module Workarea
106
106
  assert_kind_of(StorefrontSearch::ProductMultipass, trace.third.reset_by)
107
107
  end
108
108
  end
109
+
110
+ def test_exact_match_customization
111
+ IndexProduct.perform(create_product(id: '1', name: 'Foo'))
112
+ IndexProduct.perform(create_product(id: '2', name: 'Bar'))
113
+ IndexProduct.perform(create_product(id: '3', name: 'Baz'))
114
+ create_search_customization(
115
+ id: 'foo', query: 'foo', product_ids: %w(2 3)
116
+ )
117
+
118
+ search = StorefrontSearch.new(q: 'foo')
119
+
120
+ refute_nil(search.response.customization)
121
+ assert_nil(search.response.redirect)
122
+ refute_kind_of(StorefrontSearch::ExactMatches, search.used_middleware.last)
123
+ end
109
124
  end
110
125
  end
111
126
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.14
4
+ version: 3.4.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Crouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-26 00:00:00.000000000 Z
11
+ date: 2019-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -1772,7 +1772,6 @@ files:
1772
1772
  - lib/generators/workarea/style_guide/USAGE
1773
1773
  - lib/generators/workarea/style_guide/style_guide_generator.rb
1774
1774
  - lib/generators/workarea/style_guide/templates/style_guide_partial.html.haml.erb
1775
- - lib/minitest/workarea_plugin.rb
1776
1775
  - lib/tasks/assets.rake
1777
1776
  - lib/tasks/cache.rake
1778
1777
  - lib/tasks/cleanup.rake
@@ -1,11 +0,0 @@
1
- module Minitest
2
- def self.plugin_workarea_init(options)
3
- if ENV['CI'].to_s =~ /true/
4
- path = ENV['JUNIT_PATH'] || 'test/reports'
5
- FileUtils.mkdir_p(path)
6
-
7
- options[:junit] = true
8
- options[:junit_filename] = "#{path}/report.xml"
9
- end
10
- end
11
- end