Sha256: fcbb8edaf405195b89e297e8f44d5720a8132b2e07838ab726d92f219bb45efa

Contents?: true

Size: 821 Bytes

Versions: 5

Compression:

Stored size: 821 Bytes

Contents

require "test_helper"

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

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

  test "should update password" do
    patch password_url, params: { current_password: "Secret1*3*5*", password: "Secret6*4*2*", password_confirmation: "Secret6*4*2*" }
    assert_redirected_to root_url
  end

  test "should not update password with wrong current password" do
    patch password_url, params: { current_password: "SecretWrong1*3", password: "Secret6*4*2*", password_confirmation: "Secret6*4*2*" }

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
authentication-zero-2.11.2 lib/generators/authentication/templates/test_unit/controllers/html/passwords_controller_test.rb.tt
authentication-zero-2.11.1 lib/generators/authentication/templates/test_unit/controllers/html/passwords_controller_test.rb.tt
authentication-zero-2.11.0 lib/generators/authentication/templates/test_unit/controllers/html/passwords_controller_test.rb.tt
authentication-zero-2.10.0 lib/generators/authentication/templates/test_unit/controllers/html/passwords_controller_test.rb.tt
authentication-zero-2.9.3 lib/generators/authentication/templates/test_unit/controllers/html/passwords_controller_test.rb.tt