1 require "application_system_test_case"
3 class ResolveNoteTest < ApplicationSystemTestCase
4 test "can resolve an open note" do
5 note = create(:note_with_comments)
11 assert_button "Resolve"
12 assert_no_button "Comment & Resolve"
13 assert_no_button "Reactivate"
17 assert_content "Resolved note ##{note.id}"
21 test "can resolve an open note with a comment" do
22 note = create(:note_with_comments)
28 assert_button "Resolve"
29 assert_no_button "Comment & Resolve"
30 assert_no_button "Reactivate"
32 fill_in "text", :with => "Note resolve text"
34 assert_button "Comment & Resolve"
36 click_on "Comment & Resolve"
38 assert_content "Resolved note ##{note.id}"
39 assert_content "Note resolve text"
43 test "can reactivate a closed note" do
44 note = create(:note_with_comments, :closed)
50 assert_no_button "Resolve"
51 assert_no_button "Comment & Resolve"
52 assert_button "Reactivate"
56 assert_content "Unresolved note ##{note.id}"
57 assert_no_content "<iframe" # leak from share textarea
61 test "can't resolve a note when blocked" do
62 note = create(:note_with_comments)
66 create(:user_block, :user => user)
69 assert_text "Unresolved note"
70 assert_no_text "Resolved note"
71 assert_no_text "Your access to the API has been blocked"
72 assert_button "Resolve", :disabled => false
73 assert_button "Comment", :disabled => true
77 assert_text "Unresolved note"
78 assert_no_text "Resolved note"
79 assert_text "Your access to the API has been blocked"
80 assert_button "Resolve", :disabled => false
81 assert_button "Comment", :disabled => true
85 test "can't reactivate a note when blocked" do
86 note = create(:note_with_comments, :closed)
90 create(:user_block, :user => user)
93 assert_no_text "Unresolved note"
94 assert_text "Resolved note"
95 assert_no_text "Your access to the API has been blocked"
96 assert_button "Reactivate", :disabled => false
100 assert_no_text "Unresolved note"
101 assert_text "Resolved note"
102 assert_text "Your access to the API has been blocked"
103 assert_button "Reactivate", :disabled => false