X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/983e21db2e3ccc5f645f40a5f076d35e2b7897c2..e091246ffc2d640f0a7f2324998315b33b891847:/test/controllers/changeset_controller_test.rb diff --git a/test/controllers/changeset_controller_test.rb b/test/controllers/changeset_controller_test.rb index a1be3fc0f..fdb689978 100644 --- a/test/controllers/changeset_controller_test.rb +++ b/test/controllers/changeset_controller_test.rb @@ -213,7 +213,7 @@ class ChangesetControllerTest < ActionController::TestCase get :read, :params => { :id => id } assert_response :not_found, "should get a not found" rescue ActionController::UrlGenerationError => ex - assert_match /No route matches/, ex.to_s + assert_match(/No route matches/, ex.to_s) end end end @@ -287,7 +287,7 @@ class ChangesetControllerTest < ActionController::TestCase put :close, :params => { :id => id } assert_response :unauthorized, "Shouldn't be able close the non-existant changeset #{id}, when not authorized" rescue ActionController::UrlGenerationError => ex - assert_match /No route matches/, ex.to_s + assert_match(/No route matches/, ex.to_s) end end @@ -298,7 +298,7 @@ class ChangesetControllerTest < ActionController::TestCase put :close, :params => { :id => id } assert_response :not_found, "The changeset #{id} doesn't exist, so can't be closed" rescue ActionController::UrlGenerationError => ex - assert_match /No route matches/, ex.to_s + assert_match(/No route matches/, ex.to_s) end end end @@ -469,9 +469,9 @@ CHANGESET new_rel_id = doc.find("//diffResult/relation").first["new_id"].to_i # check the old IDs are all present and negative one - assert_equal -1, doc.find("//diffResult/node").first["old_id"].to_i - assert_equal -1, doc.find("//diffResult/way").first["old_id"].to_i - assert_equal -1, doc.find("//diffResult/relation").first["old_id"].to_i + assert_equal(-1, doc.find("//diffResult/node").first["old_id"].to_i) + assert_equal(-1, doc.find("//diffResult/way").first["old_id"].to_i) + assert_equal(-1, doc.find("//diffResult/relation").first["old_id"].to_i) # check the versions are present and equal one assert_equal 1, doc.find("//diffResult/node").first["new_version"].to_i @@ -1969,11 +1969,11 @@ CHANGESET def test_index_user_not_found get :index, :params => { :format => "html", :display_name => "Some random user" } assert_response :not_found - assert_template "user/no_such_user" + assert_template "users/no_such_user" get :index, :params => { :format => "html", :display_name => "Some random user", :list => "1" }, :xhr => true assert_response :not_found - assert_template "user/no_such_user" + assert_template "users/no_such_user" end ## @@ -1985,7 +1985,7 @@ CHANGESET get :index, :params => { :friends => true } assert_response :redirect - assert_redirected_to :controller => :user, :action => :login, :referer => friend_changesets_path + assert_redirected_to :controller => :users, :action => :login, :referer => friend_changesets_path session[:user] = private_user.id @@ -2009,7 +2009,7 @@ CHANGESET get :index, :params => { :nearby => true } assert_response :redirect - assert_redirected_to :controller => :user, :action => :login, :referer => nearby_changesets_path + assert_redirected_to :controller => :users, :action => :login, :referer => nearby_changesets_path session[:user] = private_user.id @@ -2153,7 +2153,9 @@ CHANGESET assert_difference "ChangesetComment.count", 1 do assert_no_difference "ActionMailer::Base.deliveries.size" do - post :comment, :params => { :id => private_user_closed_changeset.id, :text => "This is a comment" } + perform_enqueued_jobs do + post :comment, :params => { :id => private_user_closed_changeset.id, :text => "This is a comment" } + end end end assert_response :success @@ -2166,7 +2168,9 @@ CHANGESET assert_difference "ChangesetComment.count", 1 do assert_difference "ActionMailer::Base.deliveries.size", 1 do - post :comment, :params => { :id => changeset.id, :text => "This is a comment" } + perform_enqueued_jobs do + post :comment, :params => { :id => changeset.id, :text => "This is a comment" } + end end end assert_response :success @@ -2182,7 +2186,9 @@ CHANGESET assert_difference "ChangesetComment.count", 1 do assert_difference "ActionMailer::Base.deliveries.size", 2 do - post :comment, :params => { :id => changeset.id, :text => "This is a comment" } + perform_enqueued_jobs do + post :comment, :params => { :id => changeset.id, :text => "This is a comment" } + end end end assert_response :success