X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/56db9ca2b7e2475cd8025630049fb4a4b824f2d9..eed9de548363fc705af1bab13c8d5a06cdd62a11:/test/functional/notes_controller_test.rb diff --git a/test/functional/notes_controller_test.rb b/test/functional/notes_controller_test.rb index 1c0ded355..2b880943c 100644 --- a/test/functional/notes_controller_test.rb +++ b/test/functional/notes_controller_test.rb @@ -173,6 +173,13 @@ class NotesControllerTest < ActionController::TestCase end assert_response :bad_request + assert_no_difference('Note.count') do + assert_no_difference('NoteComment.count') do + post :create, {:lat => -1.0, :lon => -1.0, :text => ""} + end + end + assert_response :bad_request + assert_no_difference('Note.count') do assert_no_difference('NoteComment.count') do post :create, {:lat => -100.0, :lon => -1.0, :text => "This is a comment"} @@ -227,6 +234,11 @@ class NotesControllerTest < ActionController::TestCase end assert_response :bad_request + assert_no_difference('NoteComment.count') do + post :comment, {:id => notes(:open_note_with_comment).id, :text => ""} + end + assert_response :bad_request + assert_no_difference('NoteComment.count') do post :comment, {:id => 12345, :text => "This is an additional comment"} end @@ -236,6 +248,11 @@ class NotesControllerTest < ActionController::TestCase post :comment, {:id => notes(:hidden_note_with_comment).id, :text => "This is an additional comment"} end assert_response :gone + + assert_no_difference('NoteComment.count') do + post :comment, {:id => notes(:closed_note_with_comment).id, :text => "This is an additional comment"} + end + assert_response :conflict end def test_note_close_success @@ -273,6 +290,9 @@ class NotesControllerTest < ActionController::TestCase post :close, {:id => notes(:hidden_note_with_comment).id} assert_response :gone + + post :close, {:id => notes(:closed_note_with_comment).id} + assert_response :conflict end def test_note_read_success