Add coverage for "no change" scenario in admin change emails (#38754)

This commit is contained in:
Matt Jankowski 2026-04-20 12:05:46 -04:00 committed by GitHub
parent ccf5c09ad3
commit 28e5c3bb51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,5 +14,17 @@ RSpec.describe 'Admin Account Change Email' do
expect(response)
.to have_http_status(400)
end
context 'when email is not changed' do
subject { put admin_account_change_email_path(user.account_id, user: { unconfirmed_email: 'original@host.example' }) }
let(:user) { Fabricate :user, email: 'original@host.example' }
it 'does not updated the user record' do
expect { expect { subject }.to_not send_email }
.to not_change { user.reload.unconfirmed_email }
.and(not_change { user.reload.updated_at })
end
end
end
end