+ try_password_login user.email.upcase, "test"
+
+ assert_template "changeset/history"
+ assert_select "span.username", user.display_name
+ end
+
+ def test_login_email_password_titlecase
+ user = create(:user)
+
+ try_password_login user.email.titlecase, "test"
+
+ assert_template "changeset/history"
+ assert_select "span.username", user.display_name
+ end
+
+ def test_login_email_password_pending
+ user = create(:user, :pending)
+
+ try_password_login user.email, "test"
+
+ assert_template "confirm"
+ assert_select "span.username", false
+ end
+
+ def test_login_email_password_pending_upcase
+ user = create(:user, :pending)
+
+ try_password_login user.email.upcase, "test"
+
+ assert_template "confirm"
+ assert_select "span.username", false
+ end
+
+ def test_login_email_password_pending_titlecase
+ user = create(:user, :pending)
+
+ try_password_login user.email.titlecase, "test"
+
+ assert_template "confirm"
+ assert_select "span.username", false
+ end
+
+ def test_login_email_password_suspended
+ user = create(:user, :suspended)
+
+ try_password_login user.email, "test"