Rename a number of methods in the map_bugs controller
This commit is contained in:
parent
bb2c0c76ae
commit
f4928d0e95
8 changed files with 45 additions and 46 deletions
|
@ -6,7 +6,7 @@ class MapBugsControllerTest < ActionController::TestCase
|
|||
def test_map_bug_create_success
|
||||
assert_difference('MapBug.count') do
|
||||
assert_difference('MapBugComment.count') do
|
||||
post :add_bug, {:lat => -1.0, :lon => -1.0, :name => "new_tester", :text => "This is a comment"}
|
||||
post :create, {:lat => -1.0, :lon => -1.0, :name => "new_tester", :text => "This is a comment"}
|
||||
end
|
||||
end
|
||||
assert_response :success
|
||||
|
@ -21,7 +21,7 @@ class MapBugsControllerTest < ActionController::TestCase
|
|||
|
||||
def test_map_bug_comment_create_success
|
||||
assert_difference('MapBugComment.count') do
|
||||
post :edit_bug, {:id => 2, :name => "new_tester2", :text => "This is an additional comment"}
|
||||
post :update, {:id => 2, :name => "new_tester2", :text => "This is an additional comment"}
|
||||
end
|
||||
assert_response :success
|
||||
|
||||
|
@ -52,7 +52,7 @@ class MapBugsControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_map_bug_close_success
|
||||
post :close_bug, {:id => 2}
|
||||
post :close, {:id => 2}
|
||||
assert_response :success
|
||||
|
||||
get :read, {:id => 2, :format => 'json'}
|
||||
|
@ -62,44 +62,44 @@ class MapBugsControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_get_bugs_success
|
||||
get :get_bugs, {:bbox=>'1,1,1.2,1.2'}
|
||||
get :list, {:bbox=>'1,1,1.2,1.2'}
|
||||
assert_response :success
|
||||
|
||||
get :get_bugs, {:bbox=>'1,1,1.2,1.2', :format => 'rss'}
|
||||
get :list, {:bbox=>'1,1,1.2,1.2', :format => 'rss'}
|
||||
assert_response :success
|
||||
|
||||
get :get_bugs, {:bbox=>'1,1,1.2,1.2', :format => 'json'}
|
||||
get :list, {:bbox=>'1,1,1.2,1.2', :format => 'json'}
|
||||
assert_response :success
|
||||
|
||||
get :get_bugs, {:bbox=>'1,1,1.2,1.2', :format => 'xml'}
|
||||
get :list, {:bbox=>'1,1,1.2,1.2', :format => 'xml'}
|
||||
assert_response :success
|
||||
|
||||
get :get_bugs, {:bbox=>'1,1,1.2,1.2', :format => 'gpx'}
|
||||
get :list, {:bbox=>'1,1,1.2,1.2', :format => 'gpx'}
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
def test_get_bugs_large_area_success
|
||||
get :get_bugs, {:bbox=>'-2.5,-2.5,2.5,2.5'}
|
||||
get :list, {: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'}
|
||||
get :list, {: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'}
|
||||
get :list, {:bbox=>'1,1,1.2,1.2', :closed => '7'}
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
def test_get_bugs_closed_0_success
|
||||
get :get_bugs, {:bbox=>'1,1,1.2,1.2', :closed => '0'}
|
||||
get :list, {:bbox=>'1,1,1.2,1.2', :closed => '0'}
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
def test_get_bugs_closed_n1_success
|
||||
get :get_bugs, {:bbox=>'1,1,1.2,1.2', :closed => '-1'}
|
||||
get :list, {:bbox=>'1,1,1.2,1.2', :closed => '-1'}
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
|
@ -130,25 +130,25 @@ class MapBugsControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
def test_user_bugs_success
|
||||
get :my_bugs, {:display_name=>'test'}
|
||||
get :mine, {:display_name=>'test'}
|
||||
assert_response :success
|
||||
|
||||
get :my_bugs, {:display_name=>'pulibc_test2'}
|
||||
get :mine, {:display_name=>'pulibc_test2'}
|
||||
assert_response :success
|
||||
|
||||
get :my_bugs, {:display_name=>'non-existent'}
|
||||
get :mine, {:display_name=>'non-existent'}
|
||||
assert_response :not_found
|
||||
end
|
||||
|
||||
def test_map_bug_comment_create_not_found
|
||||
assert_no_difference('MapBugComment.count') do
|
||||
post :edit_bug, {:id => 12345, :name => "new_tester", :text => "This is an additional comment"}
|
||||
post :update, {:id => 12345, :name => "new_tester", :text => "This is an additional comment"}
|
||||
end
|
||||
assert_response :not_found
|
||||
end
|
||||
|
||||
def test_map_bug_close_not_found
|
||||
post :close_bug, {:id => 12345}
|
||||
post :close, {:id => 12345}
|
||||
assert_response :not_found
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue