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: 9e761b50c96e9eeef9c0631f22602a74917a9ddb
4
- data.tar.gz: 67eb40aaf60b99f9f940c4d6f298e8a2f52474ba
3
+ metadata.gz: 28dc225323a9f3805611079e0a1c1d3819a80db1
4
+ data.tar.gz: 86e44b4acbb7c4f3141f4dbbdeea5515f307b980
5
5
  SHA512:
6
- metadata.gz: 5ec828dde063275c45bc078455f1971c72642bf23069abd3d08dc38a5384f4d4202f9e4dfcb5cb345d5c6f54ea4a80154785f742d515021914428aab777c4cb5
7
- data.tar.gz: 311ffdde3b8d456d57947a7ff69a6059b084430922d16cf5022cbf322ab162d8e41cb393648cabe97b873fd342349496b2e558377a60d511519faf6b2e72fa32
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
- fail "Response was #{response.inspect}, expected code #{expected_response_code}" unless response.code == expected_response_code
21
- unless expected_location === response.headers[:location]
22
- fail "redirect location was #{response.headers[:location]} (expected #{expected_location})"
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, [ 302, 307 ], headers)
17
+ redirect(url, expected_location, [ 307, 302 ], headers)
18
18
  end
19
19
  end
20
20
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: akamai_rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bianca Gibson