Sha256: 9f7a2808ee87cd3ba298d9a8388b683171c83b967476dd6fca548def6f03534b

Contents?: true

Size: 764 Bytes

Versions: 3

Compression:

Stored size: 764 Bytes

Contents

require "test_helper"

class Identity::EmailsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @<%= singular_table_name %> = sign_in_as(<%= table_name %>(:lazaro_nixon))
  end

  test "should get edit" do
    get edit_identity_email_url
    assert_response :success
  end

  test "should update email" do
    patch identity_email_url, params: { email: "new_email@hey.com", current_password: "Secret1*3*5*" }
    assert_redirected_to root_url
  end

  test "should not update email with wrong current password" do
    patch identity_email_url, params: { email: "new_email@hey.com", current_password: "SecretWrong1*3" }

    assert_redirected_to edit_identity_email_url
    assert_equal "The password you entered is incorrect", flash[:alert]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
authentication-zero-2.11.2 lib/generators/authentication/templates/test_unit/controllers/html/identity/emails_controller_test.rb.tt
authentication-zero-2.11.1 lib/generators/authentication/templates/test_unit/controllers/html/identity/emails_controller_test.rb.tt
authentication-zero-2.11.0 lib/generators/authentication/templates/test_unit/controllers/html/identity/emails_controller_test.rb.tt