when "active", "confirmed" then
successful_login(user, request.env["omniauth.params"]["referer"])
when "suspended" then
- failed_login t("user.login.account is suspended", :webmaster => "mailto:#{SUPPORT_EMAIL}")
+ failed_login t("user.login.account is suspended", :webmaster => "mailto:#{SUPPORT_EMAIL}").html_safe
else
failed_login t("user.login.auth failure")
end
elsif user = User.authenticate(:username => username, :password => password, :pending => true)
unconfirmed_login(user)
elsif User.authenticate(:username => username, :password => password, :suspended => true)
- failed_login t("user.login.account is suspended", :webmaster => "mailto:#{SUPPORT_EMAIL}"), username
+ failed_login t("user.login.account is suspended", :webmaster => "mailto:#{SUPPORT_EMAIL}").html_safe, username
else
failed_login t("user.login.auth failure"), username
end
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
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
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
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
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
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