Sha256: 3c046fd9733ac8ea1c1f5bcf9f453abe820b8e325a81e70bfe7000bcdc6f6d22

Contents?: true

Size: 820 Bytes

Versions: 3

Compression:

Stored size: 820 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

3 entries across 3 versions & 1 rubygems

Version Path
kaze-0.8.0 stubs/default/test/integration/auth/authentication_test.rb
kaze-0.7.0 stubs/default/test/integration/auth/authentication_test.rb
kaze-0.6.0 stubs/default/test/integration/auth/authentication_test.rb