def comment
# Check the arguments are sane
raise OSM::APIBadUserInput.new("No id was given") unless params[:id]
- raise OSM::APIBadUserInput.new("No text was given") unless params[:text]
+ raise OSM::APIBadUserInput.new("No text was given") if params[:text].blank?
# Extract the arguments
id = params[:id].to_i
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