effective_test_bot 1.0.5 → 1.0.6

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
  SHA1:
3
- metadata.gz: 3b5e93862a13279c13941dccc609c0017608f525
4
- data.tar.gz: 7681af026c0969053b9bdc48f5e2d78eeb6f0e98
3
+ metadata.gz: 2852b7693749316a80bbf51edb8de937cc7313b5
4
+ data.tar.gz: 0f05cacd3f26e5a6391df2e9736985153157b051
5
5
  SHA512:
6
- metadata.gz: 7039bad69afa88edd7ae9617eaa52637c952fcae4342c08ed3546f2787c8dfc5d9b9f112eccc7d1abfc2fc64bac35435cd13a6f040f1cb28b676a87001a096e0
7
- data.tar.gz: 786394b805a080c664f57719f848cce65e3bd2f4c7940c3454b7bb505fd5a08d647866925a37a85d70b407bcaed6410a12a951de47569d06449114d08695bd83
6
+ metadata.gz: 3ce875ce8c9818c7ca3724703225a6c562b24f52a84f1dd7d10391af4af7747ad26a4af544458aaaa33b51f45eb2d02a3c3790f50dce11329e62bfdc51bedf40
7
+ data.tar.gz: 667b7188990f37b323026494e1ae9ec74b4885d7a9c9b3d4c79716cfe001bfd3ee99d0bddf2c2328d71386ca170003d06efa67aae27a9ae714d9e4e694431db7
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '1.0.5'.freeze
2
+ VERSION = '1.0.6'.freeze
3
3
  end
@@ -222,4 +222,10 @@ module EffectiveTestBotAssertions
222
222
  assert false, message || "(assert_email) Expected email with #{expected} to have been delivered"
223
223
  end
224
224
 
225
+ def assert_access_denied(message = nil)
226
+ assert_equal 403, response_code, message || "Expected response code 403 when access denied, but it was: #{response_code || 'nil'}"
227
+ assert_content 'Access Denied'
228
+ assert_no_exceptions
229
+ end
230
+
225
231
  end
@@ -75,17 +75,17 @@ module EffectiveTestBotTestHelper
75
75
  end
76
76
 
77
77
  def flash(key = nil)
78
- flash = page.evaluate_script('window.effective_test_bot.flash')
78
+ flash = (page.evaluate_script('window.effective_test_bot.flash') rescue nil) || {}
79
79
  key ? flash[key.to_s] : flash
80
80
  end
81
81
 
82
82
  def assigns(key = nil)
83
- assigns = page.evaluate_script('window.effective_test_bot.assigns')
83
+ assigns = (page.evaluate_script('window.effective_test_bot.assigns') rescue nil) || {}
84
84
  key ? assigns[key.to_s] : assigns
85
85
  end
86
86
 
87
87
  def access_denied_exception
88
- return nil unless page.evaluate_script('window.effective_test_bot.access_denied').present?
88
+ return nil unless (page.evaluate_script('window.effective_test_bot.access_denied') rescue nil).present?
89
89
 
90
90
  {
91
91
  exception: page.evaluate_script('window.effective_test_bot.access_denied'),
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_test_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-24 00:00:00.000000000 Z
11
+ date: 2018-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails