Sha256: b871c79a8876b39dd75aead0c01578e7c82fd94c2d705e9ac27a90eef980ef73

Contents?: true

Size: 819 Bytes

Versions: 9

Compression:

Stored size: 819 Bytes

Contents

require 'test_helper'

class Auth::AuthenticationTest < ActionDispatch::IntegrationTest
  test 'login screen can be rendered' do
    get login_path

    assert_response :success
  end

  test 'users can authenticate using the login screen' do
    user = FactoryBot.create(:user)

    post login_path, params: {
      email: user.email,
      password: 'password'
    }

    assert_authenticated
    assert_redirected_to dashboard_path
  end

  test 'users cannot authenticate with invalid password' do
    user = FactoryBot.create(:user)

    post login_path, params: {
      email: user.email,
      password: 'wrong-password'
    }

    assert_guest
  end

  test 'users can logout' do
    user = FactoryBot.create(:user)

    acting_as(user).post logout_path

    assert_guest
    assert_redirected_to '/'
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
kaze-0.17.0 stubs/default/test/integration/auth/authentication_test.rb
kaze-0.16.0 stubs/default/test/integration/auth/authentication_test.rb
kaze-0.15.0 stubs/default/test/integration/auth/authentication_test.rb
kaze-0.14.0 stubs/default/test/integration/auth/authentication_test.rb
kaze-0.13.0 stubs/default/test/integration/auth/authentication_test.rb
kaze-0.12.0 stubs/default/test/integration/auth/authentication_test.rb
kaze-0.11.0 stubs/default/test/integration/auth/authentication_test.rb
kaze-0.10.0 stubs/default/test/integration/auth/authentication_test.rb
kaze-0.9.0 stubs/default/test/integration/auth/authentication_test.rb