2
0

Merge commit from fork

* Ensure tootctl revokes sessions, access tokens and web push subscriptions

* Fix test coverage
This commit is contained in:
Emelia Smith
2025-10-13 14:20:23 +02:00
committed by GitHub
parent 8d09e4ef23
commit 24dcb18013
3 changed files with 25 additions and 8 deletions

View File

@@ -361,11 +361,20 @@ RSpec.describe Mastodon::CLI::Accounts do
context 'with --reset-password option' do
let(:options) { { reset_password: true } }
let(:user) { Fabricate(:user, password: original_password) }
let(:original_password) { 'foobar12345' }
let(:new_password) { 'new_password12345' }
it 'returns a new password for the user' do
allow(SecureRandom).to receive(:hex).and_return('new_password')
allow(SecureRandom).to receive(:hex).and_return(new_password)
allow(Account).to receive(:find_local).and_return(user.account)
allow(user).to receive(:change_password!).and_call_original
expect { subject }
.to output_results('new_password')
.to output_results(new_password)
expect(user).to have_received(:change_password!).with(new_password)
expect(user.reload).to_not be_external_or_valid_password(original_password)
end
end