eac_rails_base0 0.49.0 → 0.50.0
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: ac188619a88f33ae6b5487a4c7ac91110366befcf38b8264ca90fae0d842b982
|
4
|
+
data.tar.gz: '0690fd0be83e6a36112df3af091f22c4e002f46d8eee05662b3978d15e70a3e3'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00b5308b730afca609f01db004b3d5544008780f93ad4d0216e26e284b4d86f99bdef77d570bfc38b39edc98cc287d1a2746a89d50c0c54fa6216f30909e59a3
|
7
|
+
data.tar.gz: 93040915130456fdff9a568749ad34077e78c8910f12bfbb95c6d1fc2ebb3f8f0b3cd811ded7a0d431df66f6d500448ee677e4d334f980a59be091c7e13975e0
|
@@ -12,15 +12,39 @@ RSpec.configure do |config|
|
|
12
12
|
end
|
13
13
|
|
14
14
|
FactoryBot.define do
|
15
|
-
factory :
|
15
|
+
factory :admin_user, class: ::EacUsersSupport::User do
|
16
16
|
email { 'admin@example.com' }
|
17
17
|
password { 'mysecret' }
|
18
18
|
confirmed_at { ::Time.zone.now }
|
19
19
|
end
|
20
|
+
|
21
|
+
factory :non_admin_user, class: ::EacUsersSupport::User do
|
22
|
+
email { 'nonadmin@example.com' }
|
23
|
+
password { 'mysecret' }
|
24
|
+
confirmed_at { ::Time.zone.now }
|
25
|
+
end
|
20
26
|
end
|
21
27
|
|
22
28
|
RSpec.shared_context 'when user is admin', shared_context: :metadata do
|
23
|
-
let(:user) { ::FactoryBot.create(:
|
29
|
+
let(:user) { ::FactoryBot.create(:admin_user) }
|
30
|
+
|
31
|
+
before do
|
32
|
+
visit '/users/sign_in'
|
33
|
+
fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.email'),
|
34
|
+
with: user.email
|
35
|
+
fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.password'),
|
36
|
+
with: user.password
|
37
|
+
click_button ::I18n.translate!('devise.log_in')
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'user should be logged' do
|
41
|
+
expect(page).to have_content user.email
|
42
|
+
expect(::EacUsersSupport::User.current_user).not_to be_nil
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
RSpec.shared_context 'when user is non admin', shared_context: :metadata do
|
47
|
+
let(:user) { ::FactoryBot.create(:non_admin_user) }
|
24
48
|
|
25
49
|
before do
|
26
50
|
visit '/users/sign_in'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_rails_base0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.50.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_scaffold
|