inline_forms_installer 8.1.13 → 8.1.15
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 +4 -4
- data/lib/inline_forms_installer/version.rb +1 -1
- data/lib/installer_templates/example_app_tests/test/integration/example_app_apartment_row_turbo_test.rb +33 -0
- data/lib/installer_templates/example_app_tests/test/integration/example_app_photos_test.rb +34 -0
- data/lib/installer_templates/example_app_tests/test/integration/example_app_showcase_row_turbo_test.rb +8 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d5f4f62e8dc739c6bcde28ecb37ec09d51d96fb26083bdf7d6f5b2e0728fe118
|
|
4
|
+
data.tar.gz: 577d7275a99ed7089d373a87da0e271c24c2910054f81350f0777296a99860c4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91383e851c360f5e93ee24175c6b8f9f7bc5eb4ca9163ab167335a1c803ed054c8daa8c723e7576b586e4a03f3250411b6cc4321446ca48d0b034e8ad2d50128
|
|
7
|
+
data.tar.gz: 479e0d53b0c2531a32c943cb7c8e5350ec8b0611c3281b6bd3147b94760e3d2eaa6df6bfc6b3c649a844bf8235f682af136688091fb954b0b4c8bab3fc0663cf
|
|
@@ -100,4 +100,37 @@ class ExampleAppApartmentRowTurboTest < ExampleAppIntegrationTestCase
|
|
|
100
100
|
assert_includes @response.body, %(target="#{frame}")
|
|
101
101
|
assert_includes @response.body, %(target="#{versions_frame}")
|
|
102
102
|
end
|
|
103
|
+
|
|
104
|
+
test "destroy undo restores rich_text description edited before delete" do
|
|
105
|
+
apt = Apartment.create!(name: "Desc undo apt", title: "T")
|
|
106
|
+
body = "<p>Apartment description survives undo</p>"
|
|
107
|
+
field_frame = "apartment_#{apt.id}_description"
|
|
108
|
+
put apartment_path(
|
|
109
|
+
apt,
|
|
110
|
+
attribute: "description",
|
|
111
|
+
form_element: "rich_text",
|
|
112
|
+
update: field_frame
|
|
113
|
+
), params: { description: body },
|
|
114
|
+
headers: { "Turbo-Frame" => field_frame, "Accept" => "text/html" }
|
|
115
|
+
assert_response :success
|
|
116
|
+
assert_includes apt.reload.description.body.to_html, "survives undo"
|
|
117
|
+
|
|
118
|
+
apt_id = apt.id
|
|
119
|
+
row_frame = "apartment_#{apt_id}"
|
|
120
|
+
delete apartment_path(apt, update: row_frame), headers: @row_headers
|
|
121
|
+
assert_response :success
|
|
122
|
+
|
|
123
|
+
destroy_version = PaperTrail::Version.where(
|
|
124
|
+
item_type: "Apartment",
|
|
125
|
+
item_id: apt_id,
|
|
126
|
+
event: "destroy"
|
|
127
|
+
).order(:id).last
|
|
128
|
+
post revert_apartment_path(destroy_version, update: row_frame),
|
|
129
|
+
headers: {
|
|
130
|
+
"Turbo-Frame" => row_frame,
|
|
131
|
+
"Accept" => "text/vnd.turbo-stream.html"
|
|
132
|
+
}
|
|
133
|
+
assert_response :success
|
|
134
|
+
assert_includes Apartment.find(apt_id).description.body.to_html, "survives undo"
|
|
135
|
+
end
|
|
103
136
|
end
|
|
@@ -19,4 +19,38 @@ class ExampleAppPhotosTest < ExampleAppIntegrationTestCase
|
|
|
19
19
|
Photo.create!(name: "Sunset", apartment: @apartment)
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
test "nested photo destroy undo restores rich_text description" do
|
|
24
|
+
photo = @apartment.photos.create!(name: "undo.jpg", caption: "c")
|
|
25
|
+
body = "<p>Photo description survives undo</p>"
|
|
26
|
+
field_frame = "apartment_#{@apartment.id}_photo_#{photo.id}_description"
|
|
27
|
+
put photo_path(
|
|
28
|
+
photo,
|
|
29
|
+
attribute: "description",
|
|
30
|
+
form_element: "rich_text",
|
|
31
|
+
update: field_frame
|
|
32
|
+
), params: { description: body },
|
|
33
|
+
headers: { "Turbo-Frame" => field_frame, "Accept" => "text/html" }
|
|
34
|
+
assert_response :success
|
|
35
|
+
assert_includes photo.reload.description.body.to_html, "survives undo"
|
|
36
|
+
|
|
37
|
+
photo_id = photo.id
|
|
38
|
+
row_frame = "apartment_#{@apartment.id}_photo_#{photo_id}"
|
|
39
|
+
delete photo_path(photo, update: row_frame),
|
|
40
|
+
headers: { "Turbo-Frame" => row_frame, "Accept" => "text/html" }
|
|
41
|
+
assert_response :success
|
|
42
|
+
|
|
43
|
+
destroy_version = PaperTrail::Version.where(
|
|
44
|
+
item_type: "Photo",
|
|
45
|
+
item_id: photo_id,
|
|
46
|
+
event: "destroy"
|
|
47
|
+
).order(:id).last
|
|
48
|
+
post revert_photo_path(destroy_version, update: row_frame),
|
|
49
|
+
headers: {
|
|
50
|
+
"Turbo-Frame" => row_frame,
|
|
51
|
+
"Accept" => "text/vnd.turbo-stream.html"
|
|
52
|
+
}
|
|
53
|
+
assert_response :success
|
|
54
|
+
assert_includes Photo.find(photo_id).description.body.to_html, "survives undo"
|
|
55
|
+
end
|
|
22
56
|
end
|
|
@@ -61,11 +61,14 @@ class ExampleAppShowcaseRowTurboTest < ExampleAppIntegrationTestCase
|
|
|
61
61
|
assert_response :success
|
|
62
62
|
assert_includes @response.body, "undo"
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
destroy_version = PaperTrail::Version.where(
|
|
65
|
+
item_type: "FormElementShowcase",
|
|
66
|
+
item_id: empty_id,
|
|
67
|
+
event: "destroy"
|
|
68
|
+
).order(:id).last
|
|
69
|
+
assert destroy_version, "expected a destroy PaperTrail version"
|
|
70
|
+
assert_match %r{/form_element_showcases/#{destroy_version.id}/revert}, @response.body,
|
|
71
|
+
"undo link should target the destroy version (#{destroy_version.id}), not an update"
|
|
69
72
|
|
|
70
73
|
post revert_form_element_showcase_path(destroy_version, update: row_frame),
|
|
71
74
|
headers: {
|