]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/map_bugs_controller_test.rb
Rename some columns and indexes in the bug tables
[rails.git] / test / functional / map_bugs_controller_test.rb
index 9aa155c3eb907502710dcd72db3c65e3ae00889c..19c38834e15fdc388ac4d4f3abc1a381ece1a7ed 100644 (file)
@@ -15,8 +15,8 @@ class MapBugsControllerTest < ActionController::TestCase
     assert_response :success
     js = @response.body
     assert_match "\"status\":\"open\"", js
-    assert_match "\"comment\":\"This is a comment\"", js
-    assert_match "\"commenter_name\":\"new_tester (a)\"", js
+    assert_match "\"body\":\"This is a comment\"", js
+    assert_match "\"author_name\":\"new_tester (a)\"", js
   end
 
   def test_map_bug_comment_create_success
@@ -30,8 +30,8 @@ class MapBugsControllerTest < ActionController::TestCase
     js = @response.body
     assert_match "\"id\":2", js
     assert_match "\"status\":\"open\"", js
-    assert_match "\"comment\":\"This is an additional comment\"", js
-    assert_match "\"commenter_name\":\"new_tester2 (a)\"", js
+    assert_match "\"body\":\"This is an additional comment\"", js
+    assert_match "\"author_name\":\"new_tester2 (a)\"", js
   end
 
   def test_map_bug_read_success
@@ -79,10 +79,15 @@ class MapBugsControllerTest < ActionController::TestCase
   end
 
   def test_get_bugs_large_area_success
-    get :get_bugs, {:bbox=>'-10,-10,12,12'}
+    get :get_bugs, {:bbox=>'-2.5,-2.5,2.5,2.5'}
     assert_response :success
   end
 
+  def test_get_bugs_large_area_bad_request
+    get :get_bugs, {:bbox=>'-10,-10,12,12'}
+    assert_response :bad_request
+  end
+
   def test_get_bugs_closed_7_success
     get :get_bugs, {:bbox=>'1,1,1.2,1.2', :closed => '7'}
     assert_response :success
@@ -162,8 +167,8 @@ class MapBugsControllerTest < ActionController::TestCase
     assert_response :success
     js = @response.body
     assert_match "\"id\":5", js
-    assert_match "\"comment\":\"Valid comment for bug 5\"", js
-    assert_match "\"comment\":\"Another valid comment for bug 5\"", js
-    assert_no_match /\"comment\":\"Spam for bug 5\"/, js
+    assert_match "\"body\":\"Valid comment for bug 5\"", js
+    assert_match "\"body\":\"Another valid comment for bug 5\"", js
+    assert_no_match /\"body\":\"Spam for bug 5\"/, js
   end
 end