]> git.openstreetmap.org Git - rails.git/blobdiff - test/system/resolve_note_test.rb
Get note text only from textarea within left sidebar
[rails.git] / test / system / resolve_note_test.rb
index 90990dcbd5ed6eae0c71f63c8eefa81d05dd52f5..f9152d99be98c8fdb639e4f44c01bd84c6b91353 100644 (file)
@@ -9,6 +9,7 @@ class ResolveNoteTest < ApplicationSystemTestCase
 
     within_sidebar do
       assert_button "Resolve"
 
     within_sidebar do
       assert_button "Resolve"
+      assert_no_button "Comment & Resolve"
       assert_no_button "Reactivate"
 
       click_on "Resolve"
       assert_no_button "Reactivate"
 
       click_on "Resolve"
@@ -17,6 +18,28 @@ class ResolveNoteTest < ApplicationSystemTestCase
     end
   end
 
     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)
   test "can reactivate a closed note" do
     note = create(:note_with_comments, :closed)
     user = create(:user)
@@ -25,6 +48,7 @@ class ResolveNoteTest < ApplicationSystemTestCase
 
     within_sidebar do
       assert_no_button "Resolve"
 
     within_sidebar do
       assert_no_button "Resolve"
+      assert_no_button "Comment & Resolve"
       assert_button "Reactivate"
 
       click_on "Reactivate"
       assert_button "Reactivate"
 
       click_on "Reactivate"