Sha256: fe14c3f7cd0daf723562e081d20db98d112d1ddd59ebec1039af4b8e2601d545

Contents?: true

Size: 806 Bytes

Versions: 13

Compression:

Stored size: 806 Bytes

Contents

require 'test_helper'

class PasswordUpdateTest < ActionDispatch::IntegrationTest
  test 'password can be updated' do
    user = FactoryBot.create(:user)

    acting_as(user).put password_update_path, params: {
      current_password: 'password',
      password: 'new-password',
      password_confirmation: 'new-password'
    }

    assert_redirected_to profile_edit_path
    assert BCrypt::Password.new(user.reload.password_digest).is_password?('new-password')
  end

  test 'correct password must be provided to update password' do
    user = FactoryBot.create(:user)

    acting_as(user).put password_update_path, params: {
      current_password: 'wrong-password',
      password: 'new-password',
      password_confirmation: 'new-password'
    }

    assert_redirected_to profile_edit_path
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
kaze-1.0.1 stubs/inertia-common/test/integration/password_update_test.rb
kaze-1.0.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.19.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.18.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.17.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.16.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.15.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.14.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.13.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.12.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.11.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.10.0 stubs/inertia-common/test/integration/password_update_test.rb
kaze-0.9.0 stubs/inertia-common/test/integration/password_update_test.rb