};
if (name !== "subscribe" && name !== "unsubscribe" && name !== "reopen") {
- ajaxSettings.data = { text: $("textarea").val() };
+ ajaxSettings.data = { text: content.find("textarea").val() };
}
content.find("button[name]").prop("disabled", true);
within_sidebar do
assert_button "Resolve"
+ assert_no_button "Comment & Resolve"
assert_no_button "Reactivate"
click_on "Resolve"
end
end
+ test "can resolve an open note with a comment" 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 "Comment & Resolve"
+ assert_no_button "Reactivate"
+
+ fill_in "text", :with => "Note resolve text"
+
+ assert_button "Comment & Resolve"
+
+ click_on "Comment & Resolve"
+
+ assert_content "Resolved note ##{note.id}"
+ assert_content "Note resolve text"
+ end
+ end
+
test "can reactivate a closed note" do
note = create(:note_with_comments, :closed)
user = create(:user)
within_sidebar do
assert_no_button "Resolve"
+ assert_no_button "Comment & Resolve"
assert_button "Reactivate"
click_on "Reactivate"