effective_test_bot 1.1.11 → 1.1.12
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9e6f40e99b361f8261cf090e3ec20abafbf5cc8fe3f0203be28b0a8b9b60aa8
|
4
|
+
data.tar.gz: '0841d1cff3111e0a29f0c219e016f9c1390382e409f8e2e349371417f016d6ea'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a969606bb8d8032a2e81f7b9b1194ae069460d86f6e375101a061d1f9ac9fac8686e2f5db32e3eb115dd2f70105f7eff9c28f093819d4d6e330de6e9962a0d6
|
7
|
+
data.tar.gz: fd048bc80b9105bab36f26f8917c9ca4716f92be4d3a39df270a3a991162f841c408ff7de40cf8ad028472be88c250e5153ed2bcc6af8baabb596860ea211ee5
|
@@ -5,12 +5,12 @@ module EffectiveTestBotControllerHelper
|
|
5
5
|
def assign_test_bot_payload(payload = {})
|
6
6
|
payload.merge!({ response_code: response.code, assigns: test_bot_view_assigns, flash: flash.to_hash })
|
7
7
|
|
8
|
-
if response.content_type
|
8
|
+
if response.content_type.to_s.start_with?('text/html') && response.body[BODY_TAG].present?
|
9
9
|
payload = view_context.content_tag(:script, build_payload_javascript(payload), id: 'test_bot_payload')
|
10
10
|
|
11
11
|
split = response.body.split(BODY_TAG)
|
12
12
|
response.body = "#{split.first}#{payload}#{BODY_TAG}#{split.last if split.size > 1}"
|
13
|
-
elsif response.content_type
|
13
|
+
elsif response.content_type.to_s.start_with?('text/javascript') && response.body.present?
|
14
14
|
payload = build_payload_javascript(payload)
|
15
15
|
|
16
16
|
response.body = "#{response.body};#{payload}"
|
@@ -228,7 +228,7 @@ module CrudTest
|
|
228
228
|
|
229
229
|
after = { count: resource_class.count, archived: (resource_class.where(id: resource.id).first.try(:archived) rescue nil) }
|
230
230
|
|
231
|
-
if resource.respond_to?(:archived)
|
231
|
+
if resource.respond_to?(:archived) && before[:count] == after[:count]
|
232
232
|
assert_equal(true, after[:archived], "Expected @#{resource_name}.archived? to be true")
|
233
233
|
else
|
234
234
|
assert_equal before[:count]-1, after[:count], "Expected: #{resource_class}.count to decrement by 1"
|
@@ -17,9 +17,9 @@ module DeviseTest
|
|
17
17
|
assert_page_normal
|
18
18
|
assert_no_flash_errors unless test_bot_skip?(:no_flash_errors)
|
19
19
|
|
20
|
-
assert_signed_in(message: 'Expected @current_user to be present after sign up')
|
21
20
|
assert User.where(email: email).first.present?, "Expected user to be present after submitting sign up form at #{new_user_registration_path}"
|
22
21
|
assert_page_content(I18n.t('devise.registrations.signed_up')) unless test_bot_skip?(:page_content)
|
22
|
+
assert_signed_in(message: 'Expected @current_user to be present after sign up')
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_bot_devise_sign_in_valid_test
|
@@ -40,8 +40,8 @@ module DeviseTest
|
|
40
40
|
assert_page_normal
|
41
41
|
assert_no_flash_errors unless test_bot_skip?(:no_flash_errors)
|
42
42
|
|
43
|
-
assert_signed_in
|
44
43
|
assert_page_content(I18n.t('devise.sessions.signed_in')) unless test_bot_skip?(:page_content)
|
44
|
+
assert_signed_in
|
45
45
|
|
46
46
|
if User.new().respond_to?(:sign_in_count)
|
47
47
|
assert_equal 1, User.where(email: email).first.try(:sign_in_count), "Expected user sign in count to be incremented after signing in"
|
@@ -63,8 +63,8 @@ module DeviseTest
|
|
63
63
|
assert_assigns_errors(:user)
|
64
64
|
assert_page_normal
|
65
65
|
|
66
|
-
assert_signed_out
|
67
66
|
assert_page_content(I18n.t('devise.failure.invalid', authentication_keys: Devise.authentication_keys.join(', '))) unless test_bot_skip?(:page_content)
|
67
|
+
assert_signed_out
|
68
68
|
end
|
69
69
|
|
70
70
|
end
|
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.1.
|
4
|
+
version: 1.1.12
|
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: 2019-
|
11
|
+
date: 2019-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|