Sha256: 451d357c9a263f40f1e4ca80014e957877121b23f5d8d79e24a537f1fcd5778f

Contents?: true

Size: 927 Bytes

Versions: 5

Compression:

Stored size: 927 Bytes

Contents

require "application_system_test_case"

class SessionsTest < ApplicationSystemTestCase
  setup do
    @<%= singular_table_name %> = <%= table_name %>(:lazaro_nixon)
  end

  test "visiting the index" do
    sign_in_as @<%= singular_table_name %>

    click_on "Manage Sessions"
    assert_selector "h1", text: "Sessions"
  end

  test "signing in" do
    visit sign_in_url
    fill_in "Email", with: @<%= singular_table_name %>.email
    fill_in "Password", with: "secret123"
    click_on "Sign in"

    assert_text "Signed in successfully"
  end

  test "signing out" do
    sign_in_as @<%= singular_table_name %>

    click_on "Log out"
    assert_selector "h1", text: "Sign in"
  end

  def sign_in_as(<%= singular_table_name %>)
    visit sign_in_url
    fill_in :email, with: <%= singular_table_name %>.email
    fill_in :password, with: "secret123"
    click_on "Sign in"

    return <%= singular_table_name %>
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
authentication-zero-2.2.2 lib/generators/authentication/templates/test_unit/system/sessions_test.rb.tt
authentication-zero-2.2.1 lib/generators/authentication/templates/test_unit/system/sessions_test.rb.tt
authentication-zero-2.1.1 lib/generators/authentication/templates/test_unit/system/sessions_test.rb.tt
authentication-zero-2.1.0 lib/generators/authentication/templates/test_unit/system/sessions_test.rb.tt
authentication-zero-2.0.0 lib/generators/authentication/templates/test_unit/system/sessions_test.rb.tt