Sha256: 933146918515be48f56de5d8d2a7c3c9a87bec4c178486b873d216c5ede15912
Contents?: true
Size: 804 Bytes
Versions: 3
Compression:
Stored size: 804 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
3 entries across 3 versions & 1 rubygems