]> git.openstreetmap.org Git - rails.git/commitdiff
Test share textarea not to leak into note text on reactivation
authorAnton Khorev <tony29@yandex.ru>
Thu, 19 Dec 2024 02:14:15 +0000 (05:14 +0300)
committerAnton Khorev <tony29@yandex.ru>
Thu, 19 Dec 2024 02:14:15 +0000 (05:14 +0300)
test/system/resolve_note_test.rb [new file with mode: 0644]

diff --git a/test/system/resolve_note_test.rb b/test/system/resolve_note_test.rb
new file mode 100644 (file)
index 0000000..90990dc
--- /dev/null
@@ -0,0 +1,36 @@
+require "application_system_test_case"
+
+class ResolveNoteTest < ApplicationSystemTestCase
+  test "can resolve an open note" do
+    note = create(:note_with_comments)
+    user = create(:user)
+    sign_in_as(user)
+    visit note_path(note)
+
+    within_sidebar do
+      assert_button "Resolve"
+      assert_no_button "Reactivate"
+
+      click_on "Resolve"
+
+      assert_content "Resolved note ##{note.id}"
+    end
+  end
+
+  test "can reactivate a closed note" do
+    note = create(:note_with_comments, :closed)
+    user = create(:user)
+    sign_in_as(user)
+    visit note_path(note)
+
+    within_sidebar do
+      assert_no_button "Resolve"
+      assert_button "Reactivate"
+
+      click_on "Reactivate"
+
+      assert_content "Unresolved note ##{note.id}"
+      assert_no_content "<iframe" # leak from share textarea
+    end
+  end
+end