inline_forms_installer 8.1.15 → 8.1.16
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: 6239acf08fdfdd6a13a2bdc0cdb64d09175dc76e12297aefb854efe97b1c7210
|
|
4
|
+
data.tar.gz: 0ec799f3e8bb895459b2e581074b782757dc05806187e38d098fccf2c95d7f87
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 469c80a9b337acb714b5b80cb1b07437689893c5cc102acf68277c98484cec8edcbe812a7f51225565334e127e07090b1f3ff30de4777a94f87dba53953e4b5e
|
|
7
|
+
data.tar.gz: bd20ad4a92974a8da353c29f5bd065d2e03e82e344034d3e97ac2c8575dee5038b17131655310de0768356015454e0ccf42f12425dc90343c3ca2425f164a7e0
|
|
@@ -53,4 +53,44 @@ class ExampleAppPhotosTest < ExampleAppIntegrationTestCase
|
|
|
53
53
|
assert_response :success
|
|
54
54
|
assert_includes Photo.find(photo_id).description.body.to_html, "survives undo"
|
|
55
55
|
end
|
|
56
|
+
|
|
57
|
+
test "nested photo delete undo twice does not duplicate ActionText rows" do
|
|
58
|
+
photo = @apartment.photos.create!(name: "twice.jpg", caption: "c")
|
|
59
|
+
body = "<p>Twice undo description</p>"
|
|
60
|
+
field_frame = "apartment_#{@apartment.id}_photo_#{photo.id}_description"
|
|
61
|
+
put photo_path(
|
|
62
|
+
photo,
|
|
63
|
+
attribute: "description",
|
|
64
|
+
form_element: "rich_text",
|
|
65
|
+
update: field_frame
|
|
66
|
+
), params: { description: body },
|
|
67
|
+
headers: { "Turbo-Frame" => field_frame, "Accept" => "text/html" }
|
|
68
|
+
|
|
69
|
+
photo_id = photo.id
|
|
70
|
+
row_frame = "apartment_#{@apartment.id}_photo_#{photo_id}"
|
|
71
|
+
row_headers = { "Turbo-Frame" => row_frame, "Accept" => "text/html" }
|
|
72
|
+
stream_headers = row_headers.merge("Accept" => "text/vnd.turbo-stream.html")
|
|
73
|
+
|
|
74
|
+
2.times do
|
|
75
|
+
delete photo_path(Photo.find(photo_id), update: row_frame), headers: row_headers
|
|
76
|
+
assert_response :success
|
|
77
|
+
|
|
78
|
+
destroy_version = PaperTrail::Version.where(
|
|
79
|
+
item_type: "Photo",
|
|
80
|
+
item_id: photo_id,
|
|
81
|
+
event: "destroy"
|
|
82
|
+
).order(:id).last
|
|
83
|
+
post revert_photo_path(destroy_version, update: row_frame), headers: stream_headers
|
|
84
|
+
assert_response :success,
|
|
85
|
+
"second delete/undo must not INSERT a duplicate action_text_rich_texts id"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
assert_equal 1,
|
|
89
|
+
ActionText::RichText.where(
|
|
90
|
+
record_type: "Photo",
|
|
91
|
+
record_id: photo_id,
|
|
92
|
+
name: "description"
|
|
93
|
+
).count
|
|
94
|
+
assert_includes Photo.find(photo_id).description.body.to_html, "Twice undo"
|
|
95
|
+
end
|
|
56
96
|
end
|