effective_test_bot 1.1.35 → 1.1.36
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 +4 -4
- data/lib/effective_test_bot/version.rb +1 -1
- data/test/support/effective_test_bot_login_helper.rb +11 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b48d94a0636a8e399c6d2d70e26f5cc49e2071e34b8a81be179dc3334c52c9b
|
4
|
+
data.tar.gz: 4dbfa94a3c171506de7dcd51af8b7999573ab3017ef3984ffdf53e9530f731a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd447674df972509839eefcefa0cd04b9d10e058fe236dceabf6dc340f8df9ed50fe439177d15b8367b1966071c66c7ac60237bbd15ae1a58a19a29bd961c9e6
|
7
|
+
data.tar.gz: 2446921073f5b4b4be0f893f026cdc9526070f951cf4005fc145bf9c5ce3f7910a03f98efd98b3a4672887e7087db16373100693b271fa3c07f9faf5230bb0af
|
@@ -10,8 +10,8 @@ module EffectiveTestBotLoginHelper
|
|
10
10
|
# This is currently hardcoded to use the warden login_as test helper
|
11
11
|
def sign_in(user)
|
12
12
|
if user.kind_of?(String)
|
13
|
-
login_as(
|
14
|
-
elsif user.kind_of?(
|
13
|
+
login_as(devise_user_class.find_by_email!(user))
|
14
|
+
elsif user.kind_of?(devise_user_class)
|
15
15
|
raise 'user must be persisted' unless user.persisted?
|
16
16
|
user.reload
|
17
17
|
login_as(user)
|
@@ -28,7 +28,7 @@ module EffectiveTestBotLoginHelper
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def sign_in_manually(user_or_email, password = nil)
|
31
|
-
visit new_user_session_path
|
31
|
+
visit (respond_to?(:new_user_session_path) ? new_user_session_path : '/users/sign_in')
|
32
32
|
|
33
33
|
email = (user_or_email.respond_to?(:email) ? user_or_email.email : user_or_email)
|
34
34
|
username = (user_or_email.respond_to?(:username) ? user_or_email.username : user_or_email)
|
@@ -41,18 +41,23 @@ module EffectiveTestBotLoginHelper
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def sign_up(email: Faker::Internet.email, password: Faker::Internet.password, **options)
|
44
|
-
visit new_user_registration_path
|
44
|
+
visit (respond_to?(:new_user_registration_path) ? new_user_registration_path : '/users/sign_up')
|
45
45
|
|
46
46
|
within('form#new_user') do
|
47
47
|
fill_form({email: email, password: password, password_confirmation: password}.merge(options))
|
48
48
|
submit_novalidate_form
|
49
49
|
end
|
50
50
|
|
51
|
-
|
51
|
+
devise_user_class.find_by_email(email)
|
52
52
|
end
|
53
53
|
|
54
54
|
def current_user
|
55
|
-
|
55
|
+
return nil unless (assigns['current_user'] && assigns['current_user']['id'])
|
56
|
+
devise_user_class.where(id: assigns['current_user']['id']).first
|
57
|
+
end
|
58
|
+
|
59
|
+
def devise_user_class
|
60
|
+
User
|
56
61
|
end
|
57
62
|
|
58
63
|
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.36
|
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: 2021-02-
|
11
|
+
date: 2021-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|