- 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
- 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
- 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
- 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
- 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
- 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
user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe")
OmniAuth.config.add_mock(:openid, :uid => user.auth_uid)
user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe")
OmniAuth.config.add_mock(:openid, :uid => user.auth_uid)
assert_response :redirect
assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
assert_template "user/login"
assert_response :redirect
assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
assert_template "user/login"
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!
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!
user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe")
OmniAuth.config.add_mock(:openid, :uid => user.auth_uid)
user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe")
OmniAuth.config.add_mock(:openid, :uid => user.auth_uid)
assert_response :redirect
assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
assert_template "user/login"
assert_response :redirect
assert_redirected_to :controller => :user, :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"
+ 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!
assert_response :redirect
assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history")
follow_redirect!
user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe")
OmniAuth.config.mock_auth[:openid] = :connection_failed
user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe")
OmniAuth.config.mock_auth[:openid] = :connection_failed
assert_response :redirect
assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
assert_template "user/login"
assert_response :redirect
assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
assert_template "user/login"
assert_response :redirect
assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history")
follow_redirect!
assert_response :redirect
assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history")
follow_redirect!
user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe")
OmniAuth.config.mock_auth[:openid] = :invalid_credentials
user = create(:user, :auth_provider => "openid", :auth_uid => "http://example.com/john.doe")
OmniAuth.config.mock_auth[:openid] = :invalid_credentials
assert_response :redirect
assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
assert_template "user/login"
assert_response :redirect
assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
assert_template "user/login"
assert_response :redirect
assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history")
follow_redirect!
assert_response :redirect
assert_redirected_to auth_path(:provider => "openid", :openid_url => user.auth_uid, :origin => "/login?referer=%2Fhistory", :referer => "/history")
follow_redirect!
def test_login_openid_unknown
OmniAuth.config.add_mock(:openid, :uid => "http://localhost:1123/fred.bloggs")
def test_login_openid_unknown
OmniAuth.config.add_mock(:openid, :uid => "http://localhost:1123/fred.bloggs")
assert_response :redirect
assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
assert_template "user/login"
assert_response :redirect
assert_redirected_to :controller => :user, :action => :login, :cookie_test => true, :referer => "/history"
follow_redirect!
assert_response :success
assert_template "user/login"
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!
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!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
user = create(:user, :auth_provider => "facebook", :auth_uid => "1234567890")
OmniAuth.config.add_mock(:facebook, :uid => user.auth_uid)
user = create(:user, :auth_provider => "facebook", :auth_uid => "1234567890")
OmniAuth.config.add_mock(:facebook, :uid => user.auth_uid)
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
def test_login_facebook_invalid_credentials
OmniAuth.config.mock_auth[:facebook] = :invalid_credentials
def test_login_facebook_invalid_credentials
OmniAuth.config.mock_auth[:facebook] = :invalid_credentials
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
def test_login_facebook_unknown
OmniAuth.config.add_mock(:facebook, :uid => "987654321")
def test_login_facebook_unknown
OmniAuth.config.add_mock(:facebook, :uid => "987654321")
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
user = create(:user, :auth_provider => "windowslive", :auth_uid => "1234567890")
OmniAuth.config.add_mock(:windowslive, :uid => user.auth_uid)
user = create(:user, :auth_provider => "windowslive", :auth_uid => "1234567890")
OmniAuth.config.add_mock(:windowslive, :uid => user.auth_uid)
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
def test_login_windowslive_connection_failed
OmniAuth.config.mock_auth[:windowslive] = :connection_failed
def test_login_windowslive_connection_failed
OmniAuth.config.mock_auth[:windowslive] = :connection_failed
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
def test_login_windowslive_invalid_credentials
OmniAuth.config.mock_auth[:windowslive] = :invalid_credentials
def test_login_windowslive_invalid_credentials
OmniAuth.config.mock_auth[:windowslive] = :invalid_credentials
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
def test_login_windowslive_unknown
OmniAuth.config.add_mock(:windowslive, :uid => "987654321")
def test_login_windowslive_unknown
OmniAuth.config.add_mock(:windowslive, :uid => "987654321")
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
user = create(:user, :auth_provider => "github", :auth_uid => "1234567890")
OmniAuth.config.add_mock(:github, :uid => user.auth_uid)
user = create(:user, :auth_provider => "github", :auth_uid => "1234567890")
OmniAuth.config.add_mock(:github, :uid => user.auth_uid)
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
def test_login_github_unknown
OmniAuth.config.add_mock(:github, :uid => "987654321")
def test_login_github_unknown
OmniAuth.config.add_mock(:github, :uid => "987654321")
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
user = create(:user, :auth_provider => "wikipedia", :auth_uid => "1234567890")
OmniAuth.config.add_mock(:wikipedia, :uid => user.auth_uid)
user = create(:user, :auth_provider => "wikipedia", :auth_uid => "1234567890")
OmniAuth.config.add_mock(:wikipedia, :uid => user.auth_uid)
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
def test_login_wikipedia_connection_failed
OmniAuth.config.mock_auth[:wikipedia] = :connection_failed
def test_login_wikipedia_connection_failed
OmniAuth.config.mock_auth[:wikipedia] = :connection_failed
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
def test_login_wikipedia_invalid_credentials
OmniAuth.config.mock_auth[:wikipedia] = :invalid_credentials
def test_login_wikipedia_invalid_credentials
OmniAuth.config.mock_auth[:wikipedia] = :invalid_credentials
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
def test_login_wikipedia_unknown
OmniAuth.config.add_mock(:wikipedia, :uid => "987654321")
def test_login_wikipedia_unknown
OmniAuth.config.add_mock(:wikipedia, :uid => "987654321")
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
assert_response :redirect
assert_redirected_to "controller" => "user", "action" => "login", "cookie_test" => "true", "referer" => "/history"
follow_redirect!
- 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" }
- 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" }