Sha256: 72a775e56fc284963c7b237e98d21776ec61d16a0f6d1756b2c9b5fd9f564dd0

Contents?: true

Size: 909 Bytes

Versions: 2

Compression:

Stored size: 909 Bytes

Contents

require "application_system_test_case"

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

  test "updating the email" do
    click_on "Change email"

    fill_in "Current password", with: "secret123"
    fill_in "New email", with: "new_email@hey.com"
    click_on "Save changes"

    assert_text "Your email has been changed"
  end

  test "sending a verification email" do
    @<%= singular_table_name %>.update! verified: false

    click_on "Change email"
    click_on "Re-send verification email"

    assert_text "We sent a verification email to your email address"
  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

2 entries across 2 versions & 1 rubygems

Version Path
authentication-zero-2.2.2 lib/generators/authentication/templates/test_unit/system/emails_test.rb.tt
authentication-zero-2.2.1 lib/generators/authentication/templates/test_unit/system/emails_test.rb.tt