govuk_ab_testing 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/govuk_ab_testing/acceptance_tests/active_support.rb +14 -7
- data/lib/govuk_ab_testing/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18474bfbb55c70f00605b094d91984ed583dc453
|
4
|
+
data.tar.gz: 5720d82232f259549103a9bcc764d56ed11fab79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4195586a3e90136a9029e4df8670f785208f049be7d80f78b815eb3158d6142db21598e8c357ac05663893305932fbe57bef22e5c8e68e0ecac8707ad985b5b0
|
7
|
+
data.tar.gz: b9875cb1350159153b96085a07f81c0317e132290918a4e7f32caa4736106c8a95ff9fca0b0db2bba66971c2709e25f5adc08c125b27a409f2c8144170bef071
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## 2.3.0
|
2
|
+
|
3
|
+
* Fix for Rails 5.0.2 - the Active Support acceptance tests used to memoize
|
4
|
+
the `@request` and `@response` objects. This worked fine in Rails 4, but
|
5
|
+
it looks like Rails 5 now points to a different object at some point during
|
6
|
+
the request/response lifecycle, breaking the memoization. The fix removes
|
7
|
+
this memoization and directly queries the scope for each `@request` or
|
8
|
+
`@response`.
|
9
|
+
|
1
10
|
## 2.2.0
|
2
11
|
|
3
12
|
* Remove string interpolated parameter in error message of
|
@@ -1,16 +1,23 @@
|
|
1
1
|
module GovukAbTesting
|
2
2
|
module AcceptanceTests
|
3
3
|
class ActiveSupport
|
4
|
-
attr_reader :
|
4
|
+
attr_reader :request_headers, :scope
|
5
5
|
|
6
6
|
def initialize(scope)
|
7
|
-
@request = scope.instance_variable_get(:@request)
|
8
|
-
if @request.nil?
|
9
|
-
raise "Couldn't find '@request' defined, are you using ActiveSupport test cases?"
|
10
|
-
end
|
11
7
|
@scope = scope
|
12
8
|
@request_headers = {}
|
13
|
-
|
9
|
+
|
10
|
+
if request.nil?
|
11
|
+
raise "Couldn't find '@request' defined, are you using ActiveSupport test cases?"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def request
|
16
|
+
@scope.instance_variable_get(:@request)
|
17
|
+
end
|
18
|
+
|
19
|
+
def response
|
20
|
+
@scope.instance_variable_get(:@response)
|
14
21
|
end
|
15
22
|
|
16
23
|
def set_header(name, value)
|
@@ -19,7 +26,7 @@ module GovukAbTesting
|
|
19
26
|
end
|
20
27
|
|
21
28
|
def vary_header
|
22
|
-
|
29
|
+
response.headers['Vary']
|
23
30
|
end
|
24
31
|
|
25
32
|
def analytics_meta_tags_for_test(ab_test_name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_ab_testing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|