eac_rails_base0 0.49.0 → 0.52.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/eac_rails_base0/main_menu_helper.rb +2 -1
- data/config/routes.rb +1 -3
- data/lib/eac_rails_base0/app_base/ability.rb +1 -0
- data/lib/eac_rails_base0/app_base/ability_mapping.rb +1 -0
- data/lib/eac_rails_base0/app_base/application/envvars.rb +1 -1
- data/lib/eac_rails_base0/engine.rb +1 -1
- data/lib/eac_rails_base0/spec_helper/eac_users_support.rb +26 -2
- data/lib/eac_rails_base0/version.rb +1 -1
- metadata +19 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97b2aceeb99f1416d6e957212b8711dece7fa858f3688e21949ec8db172f8443
|
4
|
+
data.tar.gz: 1ff24528f450aec8085274adfefd4d46b1df1ef9524afa4b074f16d5f16f5abe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6af83918b2c682880880572ba53a7401d84947996d61d3e68ec329c6f512ad18e5c76992699fa879e292848c8ca5f56080e67203be52742b2a040e92d78e91c2
|
7
|
+
data.tar.gz: 4c92d69dfabb26d934e9cc5e14c3faf4d9ce45263b033ae85ed1a0772607893757a22f5e9c0fab62109549e1e19d00ac2bceb4d73d08b7bb0feb3179495a2ba8
|
@@ -49,7 +49,8 @@ module EacRailsBase0
|
|
49
49
|
|
50
50
|
def aranha_main_menu_admin_entries
|
51
51
|
{
|
52
|
-
::Aranha::Address.model_name.human(count: 2) => [aranha.addresses_path]
|
52
|
+
::Aranha::Address.model_name.human(count: 2) => [aranha.addresses_path],
|
53
|
+
::Aranha::StartPoint.model_name.human(count: 2) => [aranha.start_points_path]
|
53
54
|
}
|
54
55
|
end
|
55
56
|
|
data/config/routes.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'aranha/engine'
|
4
|
-
|
5
3
|
Rails.application.routes.draw do
|
6
4
|
mount ::EacRailsUtils::Engine => '/'
|
7
5
|
mount ::EacUsersSupport::Engine => '/'
|
8
|
-
mount ::Aranha::Engine => '/aranha'
|
6
|
+
mount ::Aranha::Rails::Engine => '/aranha'
|
9
7
|
mount ::BrRailties::Engine => '/br_railties'
|
10
8
|
|
11
9
|
namespace(:eac_rails_base0) do
|
@@ -13,6 +13,7 @@ module EacRailsBase0
|
|
13
13
|
map_devise_invitable
|
14
14
|
map_controller 'EacUsersSupport::Admin::Users', :manage, ::EacUsersSupport::User
|
15
15
|
map_controller 'Aranha::Addresses', :manage, ::Aranha::Address
|
16
|
+
map_controller 'Aranha::StartPoints', :manage, ::Aranha::StartPoint
|
16
17
|
map_controller 'BrRailties::FederalUnits', :manage, ::BrRailties::FederalUnit
|
17
18
|
map_controller 'BrRailties::Municipalities', :manage, ::BrRailties::Municipality
|
18
19
|
map_controller 'ScheduledTasks', :manage, ::ScheduledTask
|
@@ -32,7 +32,7 @@ module EacRailsBase0App
|
|
32
32
|
vars = ::EacRubyUtils::Yaml.load(path.read)
|
33
33
|
raise "\"#{path}\" does not contain a Hash" unless vars.is_a?(::Hash)
|
34
34
|
|
35
|
-
vars.each { |name, value| ENV[name.to_s] = value }
|
35
|
+
vars.each { |name, value| ENV[name.to_s] = value.to_s }
|
36
36
|
end
|
37
37
|
|
38
38
|
def setup_envvars
|
@@ -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,23 +1,20 @@
|
|
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.52.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:
|
11
|
+
date: 2021-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active_scaffold
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '3.5'
|
20
|
-
- - ">="
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 3.5.5
|
23
20
|
type: :runtime
|
@@ -25,31 +22,36 @@ dependencies:
|
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '3.5'
|
30
|
-
- - ">="
|
31
25
|
- !ruby/object:Gem::Version
|
32
26
|
version: 3.5.5
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
|
-
name: aranha
|
28
|
+
name: aranha-parsers
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
40
|
-
- - ">="
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: 0.14.2
|
33
|
+
version: '0.6'
|
43
34
|
type: :runtime
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
46
37
|
requirements:
|
47
38
|
- - "~>"
|
48
39
|
- !ruby/object:Gem::Version
|
49
|
-
version: '0.
|
50
|
-
|
40
|
+
version: '0.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: aranha-rails
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.2'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
51
53
|
- !ruby/object:Gem::Version
|
52
|
-
version: 0.
|
54
|
+
version: '0.2'
|
53
55
|
- !ruby/object:Gem::Dependency
|
54
56
|
name: bootstrap-sass
|
55
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -700,7 +702,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
700
702
|
- !ruby/object:Gem::Version
|
701
703
|
version: '0'
|
702
704
|
requirements: []
|
703
|
-
rubygems_version: 3.0.
|
705
|
+
rubygems_version: 3.0.9
|
704
706
|
signing_key:
|
705
707
|
specification_version: 4
|
706
708
|
summary: A Rails base for multiple Rails projects developed by Esquilo Azul Company.
|