akamai_rspec 1.2.6 → 1.2.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28dc225323a9f3805611079e0a1c1d3819a80db1
|
4
|
+
data.tar.gz: 86e44b4acbb7c4f3141f4dbbdeea5515f307b980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c6bb67fd369668fdcc8481501eccd28f4b12136a086ceadd14b99249bd5d22b06a75a45fde5045e3de75956bd4633be0b212ddc0db7b0e8e0b060b19648332f
|
7
|
+
data.tar.gz: 869f37657f422bce4ebc9a2bb704609616667308e9a19531451072f66551be25d503b11e51dc72274bdde880993d14780b56410d47c50dbda71458583eeca84d
|
@@ -17,9 +17,17 @@ module AkamaiRSpec
|
|
17
17
|
|
18
18
|
def redirect(url, expected_location, expected_response_code, headers)
|
19
19
|
response = AkamaiRSpec::Request.get(url, headers)
|
20
|
-
|
21
|
-
|
22
|
-
fail "
|
20
|
+
|
21
|
+
if expected_response_code.kind_of?(Array)
|
22
|
+
fail "Response was #{response.inspect}, expected code #{expected_response_code}" unless expected_response_code.include? response.code
|
23
|
+
unless expected_location === response.headers[:location]
|
24
|
+
fail "redirect location was #{response.headers[:location]} (expected #{expected_location})"
|
25
|
+
end
|
26
|
+
else
|
27
|
+
fail "Response was #{response.inspect}, expected code #{expected_response_code}" unless response.code == expected_response_code
|
28
|
+
unless expected_location === response.headers[:location]
|
29
|
+
fail "redirect location was #{response.headers[:location]} (expected #{expected_location})"
|
30
|
+
end
|
23
31
|
end
|
24
32
|
|
25
33
|
if @and_then_matchers
|
@@ -14,7 +14,7 @@ module AkamaiRSpec
|
|
14
14
|
define :be_temporarily_redirected_to do |expected_location, headers: {}|
|
15
15
|
include AkamaiRSpec::Helpers::ChainableRedirect
|
16
16
|
match do |url|
|
17
|
-
redirect(url, expected_location, [
|
17
|
+
redirect(url, expected_location, [ 307, 302 ], headers)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|