Sha256: 3f3865f0d7fb5d946b7e553e231cd8a023efc0c84e876f8743aa4186b33a69e8

Contents?: true

Size: 842 Bytes

Versions: 9

Compression:

Stored size: 842 Bytes

Contents

require "application_system_test_case"

class PasswordResetsTest < ApplicationSystemTestCase
  setup do
    @<%= singular_table_name %> = <%= table_name %>(:lazaro_nixon)
    @sid = @<%= singular_table_name %>.signed_id(purpose: :password_reset, expires_in: 20.minutes)
  end

  test "sending a password reset email" do
    visit sign_in_url
    click_on "Forgot your password?"

    fill_in "Email", with: @<%= singular_table_name %>.email
    click_on "Send password reset email"

    assert_text "Check your email for reset instructions"
  end

  test "updating password" do
    visit edit_password_reset_url(token: @sid)

    fill_in "New password", with: "new_password"
    fill_in "Confirm new password", with: "new_password"
    click_on "Save changes"

    assert_text "Your password was reset successfully. Please sign in"
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
authentication-zero-2.2.8 lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt
authentication-zero-2.2.7 lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt
authentication-zero-2.2.6 lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt
authentication-zero-2.2.5 lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt
authentication-zero-2.2.4 lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt
authentication-zero-2.2.3 lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt
authentication-zero-2.2.2 lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt
authentication-zero-2.2.1 lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt
authentication-zero-2.1.1 lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt