Combine repeated `subject` in `cli/accounts` spec shared example (#28942)

This commit is contained in:
Matt Jankowski 2024-01-26 11:35:19 -05:00 committed by GitHub
parent 1a30a517d6
commit 5fbdb2055b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 10 deletions

View File

@ -1326,18 +1326,16 @@ describe Mastodon::CLI::Accounts do
end
shared_examples 'a successful migration' do
it 'calls the MoveService for the last migration' do
expect { subject }
.to output_results('OK')
last_migration = source_account.migrations.last
expect(move_service).to have_received(:call).with(last_migration).once
end
it 'displays a successful message' do
it 'displays a success message and calls the MoveService for the last migration' do
expect { subject }
.to output_results("OK, migrated #{source_account.acct} to #{target_account.acct}")
expect(move_service)
.to have_received(:call).with(last_migration).once
end
def last_migration
source_account.migrations.last
end
end