govuk_ab_testing 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ff58dec73e2ed3af500ce0c9f9883ce44366a08
4
- data.tar.gz: b8ea71471e420af109704ff84476cc00ddcb13f3
3
+ metadata.gz: 345d3b5e64657fcdadb0a328c6dc63d60561bde8
4
+ data.tar.gz: 1e7561324d79a00b1e3fbb91fe0cb2d6ac8ecf93
5
5
  SHA512:
6
- metadata.gz: 4acc9deda25396e9fe7e5d36af8b38e0aec3c35b7931d937e4b8fd75da39bfda6a110d1ebaf06de78a67c1b2225db2e06d3c49919791dac09a09b432e1cbff97
7
- data.tar.gz: 72339f5bec3f32c374f0a95f0e73ea8b006e404d8c689719f203958eddd973a1a7b22ce0f27494a53a4b8e2f013991cd69118c9cfd3d2df4420c32c65c4b8fe4
6
+ metadata.gz: 37291f8e208496b8a581744d96a036b6d949a8dd975320f378fa0533900f7a17044bccfe183e21b490b9523034752add3090a1cba767118f36389852c142707f
7
+ data.tar.gz: 069f8ea8718bfc0fee5b9d0bacfe827eea46210d7df2d99e9b1ea2d285364f1dff76aa899f47e88e88a4db5b073e785104d017b0c5e3c3acade45c65b250f2c8
@@ -10,7 +10,8 @@ module GovukAbTesting
10
10
 
11
11
  yield
12
12
 
13
- assert_equal ab_test.response_header, response.headers['Vary'], "You probably forgot to use `configure_response`"
13
+ assert_match ab_test.response_header, response.headers['Vary'],
14
+ "You probably forgot to use `configure_response`"
14
15
 
15
16
  unless args[:assert_meta_tag] == false
16
17
  content = ab_test.meta_tag_name + ':' + requested_variant.variant_name
@@ -34,8 +34,7 @@ module GovukAbTesting
34
34
  #
35
35
  # @param [ApplicationController::Response] the `response` in the controller
36
36
  def configure_response(response)
37
- raise "We're trying to set the Vary header, but this would override the current header" if response.headers['Vary']
38
- response.headers['Vary'] = ab_test.response_header
37
+ response.headers['Vary'] = [response.headers['Vary'], ab_test.response_header].compact.join(', ')
39
38
  end
40
39
 
41
40
  # HTML meta tag used to track the results of your experiment
@@ -1,3 +1,3 @@
1
1
  module GovukAbTesting
2
- VERSION = "0.1.3".freeze
2
+ VERSION = "0.1.4".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_ab_testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev