tabletop-companion/test/controllers/password_controller_test.rb

21 lines
566 B
Ruby

# frozen_string_literal: true
require "test_helper"
class PasswordsControllerTest < ActionDispatch::IntegrationTest
test "should get edit" do
user = users(:trevor)
sign_in user
get edit_user_password_path(user)
assert_response :success
end
test "should update password" do
user = users(:trevor)
sign_in user
patch user_password_path(user), params: { user: { password: "new_password", password_confirmation: "new_password" } }
assert_redirected_to user_path(user)
assert user.reload.authenticate("new_password")
end
end