inline_forms_installer 8.1.53 → 8.1.56
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9b2831a93f9f5c8b73b05ba62ff707b93b8775979e338a51573fd58074dad7ab
|
|
4
|
+
data.tar.gz: 131524c58a0db8a9cf28838baa2d4d7b70f5e66673e2fbf911c65a36a591801e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a90ea3700df031e6cc35b6d9511c9551676d03de5b86a8fba118e0b6ac4603f8544e6b083e70b91da0ea2975908f29f9a291dca544ffcd2a4fe00725aeae6cba
|
|
7
|
+
data.tar.gz: b746466b0dc7eb1eb9852700af5a5ea28a4359c265d9cf81751afa54a396cb57d1d1967c4482e9704f0966baa69748c68a56dbf70850dd5935a663938a69289e
|
data/lib/installer_templates/example_app_tests/test/integration/example_app_devise_passwords_test.rb
ADDED
|
@@ -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.
|
|
4
|
+
version: 8.1.56
|
|
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
|