X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/f6ba15b1a3169a176a85e1d6d64abb2b7db05e90..0814b4096c443e2ab3c09baa058aa81a00d205d1:/test/controllers/user_controller_test.rb diff --git a/test/controllers/user_controller_test.rb b/test/controllers/user_controller_test.rb index e549ec90a..a5d723c91 100644 --- a/test/controllers/user_controller_test.rb +++ b/test/controllers/user_controller_test.rb @@ -4,7 +4,7 @@ class UserControllerTest < ActionController::TestCase api_fixtures def setup - stub_signup_requests + stub_hostip_requests end ## @@ -813,7 +813,7 @@ class UserControllerTest < ActionController::TestCase assert_select "form#accountForm > fieldset > div.form-row > select#user_preferred_editor > option[selected]", false # Changing to an uploaded image should work - image = Rack::Test::UploadedFile.new("test/traces/1.gif", "image/gif") + image = Rack::Test::UploadedFile.new("test/traces/a.gif", "image/gif") post :account, { :display_name => user.display_name, :image_action => "new", :user => user.attributes.merge(:image => image) }, { :user => user.id } assert_response :success assert_template :account @@ -1094,6 +1094,12 @@ class UserControllerTest < ActionController::TestCase end def test_api_gpx_files + trace1 = create(:trace, :user => users(:normal_user)) do |trace| + create(:tracetag, :trace => trace, :tag => "London") + end + trace2 = create(:trace, :user => users(:normal_user)) do |trace| + create(:tracetag, :trace => trace, :tag => "Birmingham") + end # check that nothing is returned when not logged in get :api_gpx_files assert_response :unauthorized @@ -1105,10 +1111,10 @@ class UserControllerTest < ActionController::TestCase assert_equal "text/xml", response.content_type # check the data that is returned - assert_select "gpx_file[id='1']", 1 do + assert_select "gpx_file[id='#{trace1.id}']", 1 do assert_select "tag", "London" end - assert_select "gpx_file[id='4']", 1 do + assert_select "gpx_file[id='#{trace2.id}']", 1 do assert_select "tag", "Birmingham" end end @@ -1384,7 +1390,7 @@ class UserControllerTest < ActionController::TestCase get :list, :page => 3 assert_response :success assert_template :list - assert_select "table#user_list tr", :count => 25 + assert_select "table#user_list tr", :count => 26 end def test_list_post_confirm