]> git.openstreetmap.org Git - rails.git/blob - test/system/resolve_note_test.rb
Test share textarea not to leak into note text on reactivation
[rails.git] / test / system / resolve_note_test.rb
1 require "application_system_test_case"
2
3 class ResolveNoteTest < ApplicationSystemTestCase
4   test "can resolve an open note" do
5     note = create(:note_with_comments)
6     user = create(:user)
7     sign_in_as(user)
8     visit note_path(note)
9
10     within_sidebar do
11       assert_button "Resolve"
12       assert_no_button "Reactivate"
13
14       click_on "Resolve"
15
16       assert_content "Resolved note ##{note.id}"
17     end
18   end
19
20   test "can reactivate a closed note" do
21     note = create(:note_with_comments, :closed)
22     user = create(:user)
23     sign_in_as(user)
24     visit note_path(note)
25
26     within_sidebar do
27       assert_no_button "Resolve"
28       assert_button "Reactivate"
29
30       click_on "Reactivate"
31
32       assert_content "Unresolved note ##{note.id}"
33       assert_no_content "<iframe" # leak from share textarea
34     end
35   end
36 end