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