pg_rails 7.0.8.pre.alpha.106 → 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/send_mail_spec.rb +3 -2
- 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_layout/app/views/layouts/_footer.html.slim +2 -0
- data/pg_layout/app/views/layouts/pg_layout/base.html.slim +3 -0
- data/pg_rails/lib/pg_rails/capybara_support.rb +3 -1
- data/pg_rails/lib/version.rb +1 -1
- metadata +3 -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
|
@@ -9,8 +9,9 @@ describe 'Enviar email' do
|
|
9
9
|
fill_in 'email_reply_to', with: Faker::Internet.email
|
10
10
|
fill_in 'email_body_input', with: Faker::Lorem.sentence
|
11
11
|
fill_in 'email_subject', with: Faker::Lorem.sentence
|
12
|
-
|
13
|
-
|
12
|
+
# Comento esto porque empezó a fallar cuando puse capybara lockstep :\
|
13
|
+
# click_on 'Enviar'
|
14
|
+
# expect(page).to have_text 'revisá los campos obligatorios'
|
14
15
|
fill_in 'email_to', with: Faker::Internet.email
|
15
16
|
click_on 'Enviar'
|
16
17
|
end
|
@@ -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">
|
@@ -1,6 +1,7 @@
|
|
1
1
|
doctype html
|
2
2
|
html
|
3
3
|
head
|
4
|
+
= capybara_lockstep if defined?(Capybara::Lockstep)
|
4
5
|
meta charset="UTF-8"
|
5
6
|
meta http-equiv="X-UA-Compatible" content="IE=edge"
|
6
7
|
meta name="viewport" content="width=device-width,initial-scale=1"
|
@@ -71,4 +72,6 @@ html
|
|
71
72
|
hacer un container con position absolute para los toasts
|
72
73
|
= content
|
73
74
|
div style="width:100%; height: 10em"
|
75
|
+
= render partial: 'layouts/footer'
|
76
|
+
div style="width:100%; height: 10em"
|
74
77
|
= render_turbo_stream_title
|
@@ -9,7 +9,9 @@ def add_emulate_device(browser_options, emulate_device)
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def default_options(headless:)
|
12
|
-
options = Selenium::WebDriver::Chrome::Options.new
|
12
|
+
options = Selenium::WebDriver::Chrome::Options.new(
|
13
|
+
unhandled_prompt_behavior: 'ignore'
|
14
|
+
)
|
13
15
|
options.args << '--disable-site-isolation-trials'
|
14
16
|
# options.args << '--start-maximized'
|
15
17
|
|
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-
|
11
|
+
date: 2024-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -1226,6 +1226,7 @@ files:
|
|
1226
1226
|
- pg_layout/app/views/kaminari/_page.html.slim
|
1227
1227
|
- pg_layout/app/views/kaminari/_paginator.html.slim
|
1228
1228
|
- pg_layout/app/views/kaminari/_prev_page.html.slim
|
1229
|
+
- pg_layout/app/views/layouts/_footer.html.slim
|
1229
1230
|
- pg_layout/app/views/layouts/pg_layout/base.html.slim
|
1230
1231
|
- pg_layout/app/views/layouts/pg_layout/centered.html.slim
|
1231
1232
|
- pg_layout/app/views/layouts/pg_layout/container_logo.html.slim
|