X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/95eda2d38103318a4c3c3f0c901d8e6ea86eac1e..16bef0c8ecad24ac0ca93963196bc844adbb57de:/test/integration/user_login_test.rb?ds=sidebyside diff --git a/test/integration/user_login_test.rb b/test/integration/user_login_test.rb index 337e59059..feaa92065 100644 --- a/test/integration/user_login_test.rb +++ b/test/integration/user_login_test.rb @@ -113,7 +113,9 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_template "login" assert_select "span.username", false - assert_select "div.flash.error", /your account has been suspended/ + assert_select "div.flash.error", /your account has been suspended/ do + assert_select "a[href='mailto:openstreetmap@example.com']", "webmaster" + end end def test_login_email_password_suspended_upcase @@ -123,7 +125,9 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_template "login" assert_select "span.username", false - assert_select "div.flash.error", /your account has been suspended/ + assert_select "div.flash.error", /your account has been suspended/ do + assert_select "a[href='mailto:openstreetmap@example.com']", "webmaster" + end end def test_login_email_password_suspended_titlecase @@ -133,7 +137,9 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_template "login" assert_select "span.username", false - assert_select "div.flash.error", /your account has been suspended/ + assert_select "div.flash.error", /your account has been suspended/ do + assert_select "a[href='mailto:openstreetmap@example.com']", "webmaster" + end end def test_login_email_password_blocked @@ -264,7 +270,9 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_template "login" assert_select "span.username", false - assert_select "div.flash.error", /your account has been suspended/ + assert_select "div.flash.error", /your account has been suspended/ do + assert_select "a[href='mailto:openstreetmap@example.com']", "webmaster" + end end def test_login_username_password_suspended_upcase @@ -274,7 +282,9 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_template "login" assert_select "span.username", false - assert_select "div.flash.error", /your account has been suspended/ + assert_select "div.flash.error", /your account has been suspended/ do + assert_select "a[href='mailto:openstreetmap@example.com']", "webmaster" + end end def test_login_username_password_suspended_downcase @@ -284,7 +294,9 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_template "login" assert_select "span.username", false - assert_select "div.flash.error", /your account has been suspended/ + assert_select "div.flash.error", /your account has been suspended/ do + assert_select "a[href='mailto:openstreetmap@example.com']", "webmaster" + end end def test_login_username_password_blocked @@ -341,13 +353,13 @@ class UserLoginTest < ActionDispatch::IntegrationTest user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe") OmniAuth.config.add_mock(:openid, :uid => user.auth_uid) - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history" + assert_redirected_to :controller => :users, :action => :login, :cookie_test => true, :referer => "/history" follow_redirect! assert_response :success - assert_template "user/login" - post "/login", :openid_url => "http://localhost:1123/john.doe", :referer => "/history" + assert_template "users/login" + post "/login", :params => { :openid_url => "http://localhost:1123/john.doe", :referer => "/history" } assert_response :redirect assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/john.doe", :origin => "/login?referer=%2Fhistory", :referer => "/history") follow_redirect! @@ -365,13 +377,13 @@ class UserLoginTest < ActionDispatch::IntegrationTest user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe") OmniAuth.config.add_mock(:openid, :uid => user.auth_uid) - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history" + assert_redirected_to :controller => :users, :action => :login, :cookie_test => true, :referer => "/history" follow_redirect! assert_response :success - assert_template "user/login" - post "/login", :openid_url => user.auth_uid, :remember_me_openid => true, :referer => "/history" + assert_template "users/login" + post "/login", :params => { :openid_url => user.auth_uid, :remember_me_openid => true, :referer => "/history" } assert_response :redirect assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history") follow_redirect! @@ -390,13 +402,13 @@ class UserLoginTest < ActionDispatch::IntegrationTest user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe") OmniAuth.config.mock_auth[:openid] = :connection_failed - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history" + assert_redirected_to :controller => :users, :action => :login, :cookie_test => true, :referer => "/history" follow_redirect! assert_response :success - assert_template "user/login" - post "/login", :openid_url => user.auth_uid, :referer => "/history" + assert_template "users/login" + post "/login", :params => { :openid_url => user.auth_uid, :referer => "/history" } assert_response :redirect assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history") follow_redirect! @@ -418,13 +430,13 @@ class UserLoginTest < ActionDispatch::IntegrationTest user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe") OmniAuth.config.mock_auth[:openid] = :invalid_credentials - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history" + assert_redirected_to :controller => :users, :action => :login, :cookie_test => true, :referer => "/history" follow_redirect! assert_response :success - assert_template "user/login" - post "/login", :openid_url => user.auth_uid, :referer => "/history" + assert_template "users/login" + post "/login", :params => { :openid_url => user.auth_uid, :referer => "/history" } assert_response :redirect assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history") follow_redirect! @@ -445,13 +457,13 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_openid_unknown OmniAuth.config.add_mock(:openid, :uid => "http://localhost:1123/fred.bloggs") - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history" + assert_redirected_to :controller => :users, :action => :login, :cookie_test => true, :referer => "/history" follow_redirect! assert_response :success - assert_template "user/login" - post "/login", :openid_url => "http://localhost:1123/fred.bloggs", :referer => "/history" + assert_template "users/login" + post "/login", :params => { :openid_url => "http://localhost:1123/fred.bloggs", :referer => "/history" } assert_response :redirect assert_redirected_to auth_path(:provider => "openid", :openid_url => "http://localhost:1123/fred.bloggs", :origin => "/login?referer=%2Fhistory", :referer => "/history") follow_redirect! @@ -461,7 +473,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_response :redirect follow_redirect! assert_response :success - assert_template "user/new" + assert_template "users/new" assert_select "span.username", false end @@ -471,12 +483,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest :id_info => { "openid_id" => "http://localhost:1123/fred.bloggs" } }) - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "google", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "google") @@ -491,12 +503,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_google_connection_failed OmniAuth.config.mock_auth[:google] = :connection_failed - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "google", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "google") @@ -515,12 +527,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_google_invalid_credentials OmniAuth.config.mock_auth[:google] = :invalid_credentials - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "google", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "google") @@ -541,12 +553,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest :id_info => { "openid_id" => "http://localhost:1123/fred.bloggs" } }) - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "google", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "google") @@ -554,7 +566,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_response :redirect follow_redirect! assert_response :success - assert_template "user/new" + assert_template "users/new" assert_select "span.username", false end @@ -564,12 +576,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest :id_info => { "openid_id" => user.auth_uid } }) - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "google", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "google") @@ -589,12 +601,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest user = create(:user, :auth_provider => "facebook", :auth_uid => "1234567890") OmniAuth.config.add_mock(:facebook, :uid => user.auth_uid) - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "facebook", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "facebook") @@ -609,12 +621,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_facebook_connection_failed OmniAuth.config.mock_auth[:facebook] = :connection_failed - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "facebook", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "facebook") @@ -633,12 +645,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_facebook_invalid_credentials OmniAuth.config.mock_auth[:facebook] = :invalid_credentials - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "facebook", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "facebook") @@ -657,12 +669,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_facebook_unknown OmniAuth.config.add_mock(:facebook, :uid => "987654321") - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "facebook", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "facebook") @@ -670,7 +682,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_response :redirect follow_redirect! assert_response :success - assert_template "user/new" + assert_template "users/new" assert_select "span.username", false end @@ -678,12 +690,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest user = create(:user, :auth_provider => "windowslive", :auth_uid => "1234567890") OmniAuth.config.add_mock(:windowslive, :uid => user.auth_uid) - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "windowslive", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "windowslive") @@ -698,12 +710,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_windowslive_connection_failed OmniAuth.config.mock_auth[:windowslive] = :connection_failed - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "windowslive", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "windowslive") @@ -722,12 +734,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_windowslive_invalid_credentials OmniAuth.config.mock_auth[:windowslive] = :invalid_credentials - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "windowslive", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "windowslive") @@ -746,12 +758,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_windowslive_unknown OmniAuth.config.add_mock(:windowslive, :uid => "987654321") - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "windowslive", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "windowslive") @@ -759,7 +771,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_response :redirect follow_redirect! assert_response :success - assert_template "user/new" + assert_template "users/new" assert_select "span.username", false end @@ -767,12 +779,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest user = create(:user, :auth_provider => "github", :auth_uid => "1234567890") OmniAuth.config.add_mock(:github, :uid => user.auth_uid) - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "github", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "github") @@ -787,12 +799,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_github_connection_failed OmniAuth.config.mock_auth[:github] = :connection_failed - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "github", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "github") @@ -811,12 +823,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_github_invalid_credentials OmniAuth.config.mock_auth[:github] = :invalid_credentials - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "github", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "github") @@ -835,12 +847,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_github_unknown OmniAuth.config.add_mock(:github, :uid => "987654321") - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "github", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "github") @@ -848,7 +860,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_response :redirect follow_redirect! assert_response :success - assert_template "user/new" + assert_template "users/new" assert_select "span.username", false end @@ -856,12 +868,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest user = create(:user, :auth_provider => "wikipedia", :auth_uid => "1234567890") OmniAuth.config.add_mock(:wikipedia, :uid => user.auth_uid) - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history") @@ -876,12 +888,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_wikipedia_connection_failed OmniAuth.config.mock_auth[:wikipedia] = :connection_failed - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history") @@ -900,12 +912,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_wikipedia_invalid_credentials OmniAuth.config.mock_auth[:wikipedia] = :invalid_credentials - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history") @@ -924,12 +936,12 @@ class UserLoginTest < ActionDispatch::IntegrationTest def test_login_wikipedia_unknown OmniAuth.config.add_mock(:wikipedia, :uid => "987654321") - get "/login", :referer => "/history" + get "/login", :params => { :referer => "/history" } assert_response :redirect - assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history" + assert_redirected_to "controller" => "users", "action" => "login", "cookie_test" => "true", "referer" => "/history" follow_redirect! assert_response :success - assert_template "user/login" + assert_template "users/login" get auth_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history") assert_response :redirect assert_redirected_to auth_success_path(:provider => "wikipedia", :origin => "/login?referer=%2Fhistory", :referer => "/history") @@ -937,7 +949,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_response :redirect follow_redirect! assert_response :success - assert_template "user/new" + assert_template "users/new" assert_select "span.username", false end @@ -946,7 +958,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest def try_password_login(username, password, remember_me = nil) get "/login" assert_response :redirect - assert_redirected_to :controller => :user, :action => :login, :cookie_test => true + assert_redirected_to :controller => :users, :action => :login, :cookie_test => true follow_redirect! assert_response :success assert_template "login" @@ -960,7 +972,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_select "[checked]", false end - post "/login", :username => username, :password => "wrong", :remember_me => remember_me, :referer => "/history" + post "/login", :params => { :username => username, :password => "wrong", :remember_me => remember_me, :referer => "/history" } assert_response :redirect follow_redirect! assert_response :success @@ -975,7 +987,7 @@ class UserLoginTest < ActionDispatch::IntegrationTest assert_select "[checked]", remember_me == "yes" end - post "/login", :username => username, :password => password, :remember_me => remember_me, :referer => "/history" + post "/login", :params => { :username => username, :password => password, :remember_me => remember_me, :referer => "/history" } assert_response :redirect follow_redirect! assert_response :success