]> git.openstreetmap.org Git - rails.git/blob - test/system/resolve_note_test.rb
Get note text only from textarea within left sidebar
[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 "Comment & Resolve"
13       assert_no_button "Reactivate"
14
15       click_on "Resolve"
16
17       assert_content "Resolved note ##{note.id}"
18     end
19   end
20
21   test "can resolve an open note with a comment" do
22     note = create(:note_with_comments)
23     user = create(:user)
24     sign_in_as(user)
25     visit note_path(note)
26
27     within_sidebar do
28       assert_button "Resolve"
29       assert_no_button "Comment & Resolve"
30       assert_no_button "Reactivate"
31
32       fill_in "text", :with => "Note resolve text"
33
34       assert_button "Comment & Resolve"
35
36       click_on "Comment & Resolve"
37
38       assert_content "Resolved note ##{note.id}"
39       assert_content "Note resolve text"
40     end
41   end
42
43   test "can reactivate a closed note" do
44     note = create(:note_with_comments, :closed)
45     user = create(:user)
46     sign_in_as(user)
47     visit note_path(note)
48
49     within_sidebar do
50       assert_no_button "Resolve"
51       assert_no_button "Comment & Resolve"
52       assert_button "Reactivate"
53
54       click_on "Reactivate"
55
56       assert_content "Unresolved note ##{note.id}"
57       assert_no_content "<iframe" # leak from share textarea
58     end
59   end
60 end