inline_forms_installer 8.1.53 → 8.1.55

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: d6ae21066b6f0b20f52c9d8800b0e7bf580c2dbd3124c85f8521c47d7113ed98
4
- data.tar.gz: 4e6d67961a89c567d52fb9efc82215eae83ebadc89c908556ed606a38268b316
3
+ metadata.gz: b3ecc3a0209d9a032c4b5cf90d3fe8da765056a79964ae08353b2f27f1466aa1
4
+ data.tar.gz: de2a9e404495858c6ef3dd61324351d863122e753734c473cac00b85478dc065
5
5
  SHA512:
6
- metadata.gz: 9c8cbab1fe17fd2f2c0041580a56936529c83310fd48f23df359f2f63e748bf1f5fa9aed85dd632eb42e95dadb8492ffb7410108eaefd3bec3dee609154a5c33
7
- data.tar.gz: 934023b6ec6c9ab6314573134b330e46ffbb609be112f88135ae4efae97ceed073a443cd51c630310660c61b9aed19c9f3d6d142cb7e178f47fb0f862605782d
6
+ metadata.gz: cb8633b8c5d80b8dada7ab1bf2071fc0ecda4b7c7ade7d653b22104b051fc2fb1d4207194cb67833f001e7df98bacaa5624bd6de5e77f7b405215967244b7375
7
+ data.tar.gz: 8819c4ac41b84ad29eedb337d064bffb581d5f43c3e9904a02bc64399db154cea75c45462ee0939ab8e235949a1317853b2f30546b46796220f2a59751e7c7f0
@@ -1,7 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module InlineFormsInstaller
4
- VERSION = "8.1.53"
4
+ VERSION = "8.1.55"
5
5
 
6
6
  # Canonical bare Ruby version (must match gemspec `required_ruby_version`).
7
7
  # Written verbatim into generated apps' `.ruby-version` for rbenv/chruby/asdf/
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "test_helper"
4
+
5
+ # Devise 5 removed `devise_error_messages!`; the gem's passwords/new and
6
+ # passwords/edit views still called it, so "Forgot your password?" and the
7
+ # reset link both raised (inline_forms 8.1.54). They, and the otherwise unused
8
+ # devise/shared/_header_and_errors partial, now render Devise's own
9
+ # devise/shared/error_messages partial.
10
+ class ExampleAppDevisePasswordsTest < ActionDispatch::IntegrationTest
11
+ setup do
12
+ host!("www.example.com")
13
+ @mapping = Devise.mappings.values.first
14
+ end
15
+
16
+ def path(name, **params)
17
+ Rails.application.routes.url_helpers.public_send("#{name.sub('RESOURCE', @mapping.name.to_s)}_path", **params)
18
+ end
19
+
20
+ def build_user
21
+ locale = Locale.find_or_create_by!(name: "en") { |l| l.title = "English" }
22
+ @mapping.to.create!(
23
+ email: "reset-#{SecureRandom.hex(4)}@example.com",
24
+ name: "Reset",
25
+ password: "reset9999",
26
+ password_confirmation: "reset9999",
27
+ locale: locale
28
+ )
29
+ end
30
+
31
+ test "forgot password page renders" do
32
+ get path("new_RESOURCE_password")
33
+
34
+ assert_response :success
35
+ assert_includes @response.body, %(id="inline_forms_devise_form")
36
+ end
37
+
38
+ test "unknown email re-renders the form with Devise's error list" do
39
+ post path("RESOURCE_password"),
40
+ params: { @mapping.name => { email: "nobody-#{SecureRandom.hex(4)}@example.com" } }
41
+
42
+ assert_response :unprocessable_content
43
+ assert_includes @response.body, %(id="error_explanation")
44
+ end
45
+
46
+ test "reset password page renders for a valid token" do
47
+ token = build_user.send(:set_reset_password_token)
48
+
49
+ get path("edit_RESOURCE_password", reset_password_token: token)
50
+
51
+ assert_response :success
52
+ assert_includes @response.body, %(id="inline_forms_devise_form")
53
+ end
54
+
55
+ test "header_and_errors partial shows the app name and the resource errors" do
56
+ resource = @mapping.to.new
57
+ resource.errors.add(:email, "is broken")
58
+ renderer = Devise::PasswordsController.renderer.new("devise.mapping" => @mapping)
59
+
60
+ html = renderer.render(partial: "devise/shared/header_and_errors",
61
+ locals: { resource: resource })
62
+
63
+ assert_includes html, %(<div id="large_title">#{ERB::Util.h(ApplicationController.helpers.application_name)}</div>)
64
+ assert_includes html, %(id="error_explanation")
65
+ assert_includes html, "is broken"
66
+ refute_includes html, "translation_missing"
67
+ end
68
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms_installer
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.53
4
+ version: 8.1.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares
@@ -97,6 +97,7 @@ files:
97
97
  - lib/installer_templates/example_app_tests/test/integration/example_app_apartment_top_level_new_test.rb
98
98
  - lib/installer_templates/example_app_tests/test/integration/example_app_apartment_top_level_pagination_test.rb
99
99
  - lib/installer_templates/example_app_tests/test/integration/example_app_apartment_versions_turbo_test.rb
100
+ - lib/installer_templates/example_app_tests/test/integration/example_app_devise_passwords_test.rb
100
101
  - lib/installer_templates/example_app_tests/test/integration/example_app_guest_access_test.rb
101
102
  - lib/installer_templates/example_app_tests/test/integration/example_app_layout_title_test.rb
102
103
  - lib/installer_templates/example_app_tests/test/integration/example_app_owner_tabs_test.rb