Merge branch 'master' into moderation
This commit is contained in:
commit
ae44879213
139 changed files with 6377 additions and 1766 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
require "test_helper"
|
||||
require "geocoder_controller"
|
||||
|
||||
|
@ -425,6 +424,12 @@ class GeocoderControllerTest < ActionController::TestCase
|
|||
results_check :name => "Dinant Link Road, Broxbourne, Hertfordshire, East of England, England, EN11 8HX, United Kingdom",
|
||||
:lat => 51.7634883, :lon => -0.0088373,
|
||||
:type => "way", :id => 3489841, :zoom => 17
|
||||
|
||||
get :search_osm_nominatim_reverse, :xhr => true,
|
||||
:params => { :lat => 13.7709, :lon => 100.50507, :zoom => 19 }
|
||||
results_check :name => "MM Steak&Grill, ถนนศรีอยุธยา, บางขุนพรหม, กรุงเทพมหานคร, เขตดุสิต, กรุงเทพมหานคร, 10300, ประเทศไทย",
|
||||
:lat => 13.7708691, :lon => 100.505073233221,
|
||||
:type => "way", :id => 542901374, :zoom => 19
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -455,7 +455,7 @@ class NodeControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
# check error when a non-existent node is included
|
||||
get :nodes, :params => { :nodes => "#{node1.id},#{node2.id},#{node3.id},#{node4.id},#{node5.id},400" }
|
||||
get :nodes, :params => { :nodes => "#{node1.id},#{node2.id},#{node3.id},#{node4.id},#{node5.id},0" }
|
||||
assert_response :not_found
|
||||
end
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ class RelationControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
# check error when a non-existent relation is included
|
||||
get :relations, :params => { :relations => "#{relation1.id},#{relation2.id},#{relation3.id},#{relation4.id},400" }
|
||||
get :relations, :params => { :relations => "#{relation1.id},#{relation2.id},#{relation3.id},#{relation4.id},0" }
|
||||
assert_response :not_found
|
||||
end
|
||||
|
||||
|
|
|
@ -550,6 +550,9 @@ class TraceControllerTest < ActionController::TestCase
|
|||
post :create, :params => { :trace => { :gpx_file => file, :description => "New Trace", :tagstring => "new,trace", :visibility => "trackable" } }
|
||||
assert_response :forbidden
|
||||
|
||||
# Rewind the file
|
||||
file.rewind
|
||||
|
||||
# Now authenticated
|
||||
create(:user_preference, :user => user, :k => "gps.trace.visibility", :v => "identifiable")
|
||||
assert_not_equal "trackable", user.preferences.where(:k => "gps.trace.visibility").first.v
|
||||
|
@ -829,6 +832,9 @@ class TraceControllerTest < ActionController::TestCase
|
|||
post :api_create, :params => { :file => file, :description => "New Trace", :tags => "new,trace", :visibility => "trackable" }
|
||||
assert_response :unauthorized
|
||||
|
||||
# Rewind the file
|
||||
file.rewind
|
||||
|
||||
# Now authenticated
|
||||
create(:user_preference, :user => user, :k => "gps.trace.visibility", :v => "identifiable")
|
||||
assert_not_equal "trackable", user.preferences.where(:k => "gps.trace.visibility").first.v
|
||||
|
|
|
@ -134,5 +134,10 @@ class UserRolesControllerTest < ActionController::TestCase
|
|||
end
|
||||
assert_redirected_to user_path(target_user.display_name)
|
||||
assert_equal "The string `no_such_role' is not a valid role.", flash[:error]
|
||||
|
||||
# Revoking administrator role from current user should fail
|
||||
post :revoke, :params => { :display_name => administrator_user.display_name, :role => "administrator" }
|
||||
assert_redirected_to user_path(administrator_user.display_name)
|
||||
assert_equal "Cannot revoke administrator role from current user.", flash[:error]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -105,7 +105,7 @@ class WayControllerTest < ActionController::TestCase
|
|||
end
|
||||
|
||||
# check error when a non-existent way is included
|
||||
get :ways, :params => { :ways => "#{way1.id},#{way2.id},#{way3.id},#{way4.id},400" }
|
||||
get :ways, :params => { :ways => "#{way1.id},#{way2.id},#{way3.id},#{way4.id},0" }
|
||||
assert_response :not_found
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue