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: 6af95bb6d865ba96bce913db79e8de93b2ec99edb2b0b89377e212f6bc596524
4
- data.tar.gz: a482b176d1508063b16bc6c6feab3c927bc3637dacb5c7332f3bf04ab56b619b
3
+ metadata.gz: ac188619a88f33ae6b5487a4c7ac91110366befcf38b8264ca90fae0d842b982
4
+ data.tar.gz: '0690fd0be83e6a36112df3af091f22c4e002f46d8eee05662b3978d15e70a3e3'
5
5
  SHA512:
6
- metadata.gz: 3afaf64af256027d1a6f97e48563b33918faf9b67466f2a10a6dca55c061d8ffe9d596bdbd370700b485b1dfb4d6a84ee4e5fec6815a36767bae7501dc92957a
7
- data.tar.gz: 3e2872006a5a534968958c2955a34531596d673d7a455a5461486d61c60e46d021e8021aa8969321fb751fa77b4c938aa4ecbb8e5dc37e3b957fa3e388d5d271
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 :user, class: ::EacUsersSupport::User do
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(:user) }
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'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRailsBase0
4
- VERSION = '0.49.0'
4
+ VERSION = '0.50.0'
5
5
  end
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.49.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-10-23 00:00:00.000000000 Z
11
+ date: 2020-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_scaffold