Sha256: 1c42e21f786d7602b30d3508ed3d9e919f1ab845726bce0ec65e942a1a322f2d
Contents?: true
Size: 1.46 KB
Versions: 10
Compression:
Stored size: 1.46 KB
Contents
require 'test_helper' class ProfileTest < ActionDispatch::IntegrationTest test 'profile page is displayed' do user = FactoryBot.create(:user) acting_as(user).get profile_edit_path assert_response :success end test 'profile information can be updated' do user = FactoryBot.create(:user) acting_as(user).patch profile_edit_path, params: { name: 'Test User', email: 'test@example.com' } assert_redirected_to profile_edit_path user.reload assert_equal 'Test User', user.name assert_equal 'test@example.com', user.email end test 'email verification status is unchanged when the email address is unchanged' do user = FactoryBot.create(:user) acting_as(user).patch profile_edit_path, params: { name: 'Test User', email: user.email } assert_redirected_to profile_edit_path assert_not user.reload.email_verified_at.blank? end test 'user can delete their account' do user = FactoryBot.create(:user) acting_as(user).delete profile_destroy_path, params: { password: 'password' } assert_redirected_to '/' assert_guest assert_raise(ActiveRecord::RecordNotFound) { user.reload } end test 'correct password must be provided to delete account' do user = FactoryBot.create(:user) acting_as(user).delete profile_destroy_path, params: { password: 'wrong-password' } assert_redirected_to profile_edit_path assert_not_nil user.reload end end
Version data entries
10 entries across 10 versions & 1 rubygems