require "test_helper"
class UserLoginTest < ActionDispatch::IntegrationTest
- fixtures :users, :user_blocks
+ fixtures :users, :user_roles
def setup
OmniAuth.config.test_mode = true
def test_login_email_password_blocked
user = users(:blocked_user)
+ create(:user_block, :needs_view, :user => user)
try_password_login user.email, "test"
def test_login_email_password_blocked_upcase
user = users(:blocked_user)
+ create(:user_block, :needs_view, :user => user)
try_password_login user.email.upcase, "test"
def test_login_email_password_blocked_titlecase
user = users(:blocked_user)
+ create(:user_block, :needs_view, :user => user)
try_password_login user.email.titlecase, "test"
def test_login_username_password_blocked
user = users(:blocked_user)
+ create(:user_block, :needs_view, :user => user)
try_password_login user.display_name.upcase, "test"
def test_login_username_password_blocked_upcase
user = users(:blocked_user)
+ create(:user_block, :needs_view, :user => user)
try_password_login user.display_name, "test"
def test_login_username_password_blocked_titlecase
user = users(:blocked_user)
+ create(:user_block, :needs_view, :user => user)
try_password_login user.display_name.titlecase, "test"
assert_template "changeset/history"
assert_select "span.username", "openIDuser"
- user = User.find_by_display_name("openIDuser")
+ user = User.find_by(:display_name => "openIDuser")
assert_equal "google", user.auth_provider
assert_equal "987654321", user.auth_uid
end