Merge commit from fork
* Ensure tootctl revokes sessions, access tokens and web push subscriptions * Fix test coverage --------- Co-authored-by: Emelia Smith <ThisIsMissEm@users.noreply.github.com>
This commit is contained in:
parent
8477bec2f2
commit
1631fb80e8
3 changed files with 25 additions and 8 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue