pg_rails 7.0.8.pre.alpha.107 → 7.0.8.pre.alpha.108
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/pg_engine/app/controllers/pg_engine/devise_controller.rb +1 -1
- data/pg_engine/app/controllers/pg_engine/health_controller.rb +0 -1
- data/pg_engine/app/helpers/pg_engine/form_helper.rb +0 -1
- data/pg_engine/app/lib/pg_form_builder.rb +1 -1
- data/pg_engine/app/models/user.rb +4 -0
- data/pg_engine/config/locales/es.yml +1 -0
- data/pg_engine/spec/system/signup_spec.rb +22 -2
- data/pg_layout/app/lib/navbar.rb +1 -1
- data/pg_layout/app/views/devise/registrations/new.html.erb +1 -0
- data/pg_rails/lib/version.rb +1 -1
- 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: 5174c715d280ab0c7e5581bd88d2e6cf7ee11507fc739f6369d959fc6d858acd
|
4
|
+
data.tar.gz: 87f88575ab82c80780fd12a5a65a7dc8c308d5aa828451cdd010121bf9ea8e00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: badbc2f74fe7d8b706e9cb2c38284dd92a99f43732fb8162449094ac3b9627d03a91245351e2eb7a1286acf50a82991584ae04ce777326eba975c43e3626d187
|
7
|
+
data.tar.gz: a2b4ad07bfe5398f89c76490caaa092253f0956d2d7762d6800d99d0bc483cdff7e22a528f3159f6277ab9fdad3b3922e181b29909c66e1a48dd1c922898c7be
|
@@ -11,7 +11,7 @@ module PgEngine
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def configure_permitted_parameters
|
14
|
-
devise_parameter_sanitizer.permit(:sign_up, keys: %i[nombre apellido])
|
14
|
+
devise_parameter_sanitizer.permit(:sign_up, keys: %i[nombre apellido accept_terms])
|
15
15
|
devise_parameter_sanitizer.permit(:account_update, keys: %i[nombre apellido])
|
16
16
|
end
|
17
17
|
end
|
@@ -34,7 +34,7 @@ class PgFormBuilder < SimpleForm::FormBuilder
|
|
34
34
|
base_message = (base_errors.map(&:to_s).join('<br>') if base_errors.present?)
|
35
35
|
base_tag = error_notification(message: base_message, class: 'alert alert-danger') if base_message
|
36
36
|
|
37
|
-
"#{title}#{base_tag}".html_safe
|
37
|
+
"#{title}#{base_tag}".html_safe
|
38
38
|
end
|
39
39
|
|
40
40
|
def mensaje
|
@@ -50,6 +50,10 @@ class User < ApplicationRecord
|
|
50
50
|
validates_length_of :password, if: :password_required?, within: 6..128,
|
51
51
|
message: 'es demasiado corta (6 caracteres mínimo)'
|
52
52
|
|
53
|
+
validates :accept_terms, acceptance: {
|
54
|
+
message: 'Para crear una cuenta es necesario que aceptes los términos y condiciones'
|
55
|
+
}
|
56
|
+
|
53
57
|
attr_accessor :orphan
|
54
58
|
|
55
59
|
after_create do
|
@@ -22,13 +22,33 @@ describe 'Al Registrarse' do
|
|
22
22
|
fill_in 'user_apellido', with: Faker::Name.name
|
23
23
|
fill_in 'user_password', with: 'admin123'
|
24
24
|
fill_in 'user_password_confirmation', with: 'admin123'
|
25
|
+
|
26
|
+
accept_terms
|
27
|
+
|
25
28
|
instance_exec('input[type=submit]', &find_scroll).click
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
context 'cuando acepta los términos' do
|
33
|
+
let(:accept_terms) do
|
34
|
+
check 'user_accept_terms'
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'guarda el user' do
|
38
|
+
expect { subject }.to change(User, :count).by(1)
|
26
39
|
expect(page).to have_text('Te enviamos un correo electrónico con instrucciones')
|
27
40
|
end
|
28
41
|
end
|
29
42
|
|
30
|
-
|
31
|
-
|
43
|
+
context 'si no acepta los terms' do
|
44
|
+
let(:accept_terms) do
|
45
|
+
nil
|
46
|
+
end
|
47
|
+
|
48
|
+
it do
|
49
|
+
subject
|
50
|
+
expect(page).to have_text 'es necesario que aceptes los términos y condiciones'
|
51
|
+
end
|
32
52
|
end
|
33
53
|
end
|
34
54
|
|
data/pg_layout/app/lib/navbar.rb
CHANGED
@@ -34,7 +34,7 @@ class Navbar
|
|
34
34
|
bar_data.map do |item|
|
35
35
|
{
|
36
36
|
title: item['name'],
|
37
|
-
attributes: item['attributes']&.html_safe,
|
37
|
+
attributes: item['attributes']&.html_safe,
|
38
38
|
path: eval(item['path']),
|
39
39
|
show: item['policy'] ? eval(item['policy']) : true
|
40
40
|
}
|
@@ -16,6 +16,7 @@
|
|
16
16
|
<%= f.input :password_confirmation,
|
17
17
|
required: true,
|
18
18
|
input_html: { autocomplete: "new-password" } %>
|
19
|
+
<%= f.input :accept_terms, as: :boolean, label: t('attributes.accept_terms').html_safe, error_prefix: '' %>
|
19
20
|
</div>
|
20
21
|
|
21
22
|
<div class="form-actions">
|
data/pg_rails/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.8.pre.alpha.
|
4
|
+
version: 7.0.8.pre.alpha.108
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martín Rosso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|