eac_rails_base0 0.55.1 → 0.55.2
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/app/assets/javascripts/eac_rails_base0.js +1 -0
- data/app/assets/stylesheets/eac_rails_base0.scss +1 -0
- data/app/controllers/eac_rails_base0/application_controller.rb +1 -0
- data/config/initializers/devise.rb +14 -0
- data/lib/eac_rails_base0/app_base/ability.rb +1 -0
- data/lib/eac_rails_base0/engine.rb +1 -0
- data/lib/eac_rails_base0/rspec/setup.rb +6 -58
- data/lib/eac_rails_base0/rspec/shared_contexts/when_user_is_admin.rb +22 -0
- data/lib/eac_rails_base0/rspec/shared_contexts/when_user_is_anonymous.rb +23 -0
- data/lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb +22 -0
- data/lib/eac_rails_base0/version.rb +1 -1
- metadata +24 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 025d0d3fba613f0a893722bbacba3045eac5963db25c04b9444cfe9a98b53609
|
4
|
+
data.tar.gz: 46f4048b0867dcc00ea04a150c7b373a4d7fd2486a9b81062622c081c0cc6c61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 594ff2ef0508e05afc16938f100e6922592f33dd054298a83a30cefbe4d3164f31b9250801eb67eae3e6e2c996c655fb5096b447dd6f6b1aeb11cc631edc5764
|
7
|
+
data.tar.gz: 7ffc764febce192a0e2060bcc5d5040d9bb12ed1e8053eaf1f55b628527373d48610ceb157cb58626c3ded734073d4b8ad3e3084af3616b025963d357507c7d5
|
@@ -11,6 +11,7 @@ module EacRailsBase0
|
|
11
11
|
helper ::EacRailsUtils::FormatterHelper
|
12
12
|
helper ::EacRailsUtils::LinksHelper
|
13
13
|
helper ::EacRailsUtils::OpenGraphProtocolHelper
|
14
|
+
helper ::EacRailsBase0::PanelDefaultHelper
|
14
15
|
helper ::EacRailsBase0::UserMenuHelper
|
15
16
|
|
16
17
|
# Prevent CSRF attacks by raising an exception.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'devise'
|
4
|
+
|
5
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
6
|
+
# Many of these configuration options can be set straight in your model.
|
7
|
+
Devise.setup do |config|
|
8
|
+
#
|
9
|
+
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
|
10
|
+
# so you need to do it manually. For the users scope, it would be:
|
11
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
12
|
+
|
13
|
+
# config.parent_controller = 'EacRailsBase0::ApplicationController'
|
14
|
+
end
|
@@ -46,68 +46,16 @@ module EacRailsBase0
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
-
def setup_admin_example
|
50
|
-
|
51
|
-
let(:user) { ::FactoryBot.create(:admin_user) }
|
52
|
-
|
53
|
-
before do
|
54
|
-
visit '/users/sign_in'
|
55
|
-
fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.email'),
|
56
|
-
with: user.email
|
57
|
-
fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.password'),
|
58
|
-
with: user.password
|
59
|
-
click_button ::I18n.translate!('devise.log_in')
|
60
|
-
end
|
61
|
-
|
62
|
-
it 'user should be logged' do
|
63
|
-
expect(page).to have_content user.email
|
64
|
-
expect(::EacUsersSupport::User.current_user).not_to be_nil
|
65
|
-
end
|
66
|
-
end
|
49
|
+
def setup_admin_example
|
50
|
+
require 'eac_rails_base0/rspec/shared_contexts/when_user_is_admin'
|
67
51
|
end
|
68
52
|
|
69
|
-
def setup_non_admin_example
|
70
|
-
|
71
|
-
let(:user) { ::FactoryBot.create(:non_admin_user) }
|
72
|
-
|
73
|
-
before do
|
74
|
-
visit '/users/sign_in'
|
75
|
-
fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.email'),
|
76
|
-
with: user.email
|
77
|
-
fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.password'),
|
78
|
-
with: user.password
|
79
|
-
click_button ::I18n.translate!('devise.log_in')
|
80
|
-
end
|
81
|
-
|
82
|
-
it 'user should be logged' do
|
83
|
-
expect(page).to have_content user.email
|
84
|
-
expect(::EacUsersSupport::User.current_user).not_to be_nil
|
85
|
-
end
|
86
|
-
end
|
53
|
+
def setup_non_admin_example
|
54
|
+
require 'eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin'
|
87
55
|
end
|
88
56
|
|
89
|
-
def setup_anonymous_example
|
90
|
-
|
91
|
-
before do
|
92
|
-
visit '/'
|
93
|
-
if link_exist?(::I18n.translate!('devise.log_out'))
|
94
|
-
click_link(::I18n.translate!('devise.log_out'))
|
95
|
-
elsif !link_exist?(::I18n.translate!('devise.log_in'))
|
96
|
-
raise 'login nor logout link found'
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
it 'user should be not logged' do
|
101
|
-
expect(::EacUsersSupport::User.current_user).to be_nil
|
102
|
-
end
|
103
|
-
|
104
|
-
def link_exist?(locator) # rubocop:disable Lint/NestedMethodDefinition
|
105
|
-
find_link(locator)
|
106
|
-
true
|
107
|
-
rescue Capybara::ElementNotFound
|
108
|
-
false
|
109
|
-
end
|
110
|
-
end
|
57
|
+
def setup_anonymous_example
|
58
|
+
require 'eac_rails_base0/rspec/shared_contexts/when_user_is_anonymous'
|
111
59
|
end
|
112
60
|
end
|
113
61
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
::RSpec.shared_context 'when user is admin', shared_context: :metadata do
|
4
|
+
let(:user) { ::FactoryBot.create(:admin_user) }
|
5
|
+
|
6
|
+
before do
|
7
|
+
visit '/users/sign_in'
|
8
|
+
fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.email'),
|
9
|
+
with: user.email
|
10
|
+
fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.password'),
|
11
|
+
with: user.password
|
12
|
+
click_button ::I18n.translate!('devise.log_in')
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'user should be logged' do
|
16
|
+
expect(page).to have_content user.email
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should be a link to logout' do
|
20
|
+
expect(page).to have_link(nil, href: '/users/sign_out')
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
::RSpec.shared_context 'when user is anonymous', shared_context: :metadata do
|
4
|
+
before do
|
5
|
+
visit '/'
|
6
|
+
if link_exist?(::I18n.translate!('devise.log_out'))
|
7
|
+
click_link(::I18n.translate!('devise.log_out'))
|
8
|
+
elsif !link_exist?(::I18n.translate!('devise.log_in'))
|
9
|
+
raise 'login nor logout link found'
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'should be a link to log in' do
|
14
|
+
expect(page).to have_link(nil, href: '/users/sign_in')
|
15
|
+
end
|
16
|
+
|
17
|
+
def link_exist?(locator)
|
18
|
+
find_link(locator)
|
19
|
+
true
|
20
|
+
rescue Capybara::ElementNotFound
|
21
|
+
false
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
::RSpec.shared_context 'when user is non admin', shared_context: :metadata do
|
4
|
+
let(:user) { ::FactoryBot.create(:non_admin_user) }
|
5
|
+
|
6
|
+
before do
|
7
|
+
visit '/users/sign_in'
|
8
|
+
fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.email'),
|
9
|
+
with: user.email
|
10
|
+
fill_in ::I18n.translate!('activerecord.attributes.eac_users_support/user.password'),
|
11
|
+
with: user.password
|
12
|
+
click_button ::I18n.translate!('devise.log_in')
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'user should be logged' do
|
16
|
+
expect(page).to have_content user.email
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should be a link to logout' do
|
20
|
+
expect(page).to have_link(nil, href: '/users/sign_out')
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eac_rails_base0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.55.
|
4
|
+
version: 0.55.2
|
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: 2021-09-
|
11
|
+
date: 2021-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: active_scaffold
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 3.5.5
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 3.5.5
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: aranha-parsers
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,6 +126,20 @@ dependencies:
|
|
140
126
|
- - ">="
|
141
127
|
- !ruby/object:Gem::Version
|
142
128
|
version: 4.2.2
|
129
|
+
- !ruby/object:Gem::Dependency
|
130
|
+
name: eac_active_scaffold
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - "~>"
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0.1'
|
136
|
+
type: :runtime
|
137
|
+
prerelease: false
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - "~>"
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0.1'
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
name: eac_cli
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -364,16 +364,16 @@ dependencies:
|
|
364
364
|
name: rails-i18n
|
365
365
|
requirement: !ruby/object:Gem::Requirement
|
366
366
|
requirements:
|
367
|
-
- - "
|
367
|
+
- - ">="
|
368
368
|
- !ruby/object:Gem::Version
|
369
|
-
version: '
|
369
|
+
version: '0'
|
370
370
|
type: :runtime
|
371
371
|
prerelease: false
|
372
372
|
version_requirements: !ruby/object:Gem::Requirement
|
373
373
|
requirements:
|
374
|
-
- - "
|
374
|
+
- - ">="
|
375
375
|
- !ruby/object:Gem::Version
|
376
|
-
version: '
|
376
|
+
version: '0'
|
377
377
|
- !ruby/object:Gem::Dependency
|
378
378
|
name: recordselect
|
379
379
|
requirement: !ruby/object:Gem::Requirement
|
@@ -565,6 +565,7 @@ files:
|
|
565
565
|
- config/initializers/backtrace_silencers.rb
|
566
566
|
- config/initializers/carrier_wave.rb
|
567
567
|
- config/initializers/cookies_serializer.rb
|
568
|
+
- config/initializers/devise.rb
|
568
569
|
- config/initializers/filter_parameter_logging.rb
|
569
570
|
- config/initializers/mime_types.rb
|
570
571
|
- config/initializers/patches.rb
|
@@ -614,6 +615,9 @@ files:
|
|
614
615
|
- lib/eac_rails_base0/patches/url_for_patch.rb
|
615
616
|
- lib/eac_rails_base0/rspec.rb
|
616
617
|
- lib/eac_rails_base0/rspec/setup.rb
|
618
|
+
- lib/eac_rails_base0/rspec/shared_contexts/when_user_is_admin.rb
|
619
|
+
- lib/eac_rails_base0/rspec/shared_contexts/when_user_is_anonymous.rb
|
620
|
+
- lib/eac_rails_base0/rspec/shared_contexts/when_user_is_non_admin.rb
|
617
621
|
- lib/eac_rails_base0/version.rb
|
618
622
|
- lib/eac_rails_base0/x_engine.rb
|
619
623
|
- lib/fog.rb
|