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

pull/28951/head
Matt Jankowski 11 months ago committed by GitHub
parent 1a30a517d6
commit 5fbdb2055b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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
it 'displays a success message and calls the MoveService for the last migration' do
expect { subject }
.to output_results('OK')
last_migration = source_account.migrations.last
.to output_results("OK, migrated #{source_account.acct} to #{target_account.acct}")
expect(move_service).to have_received(:call).with(last_migration).once
expect(move_service)
.to have_received(:call).with(last_migration).once
end
it 'displays a successful message' do
expect { subject }
.to output_results("OK, migrated #{source_account.acct} to #{target_account.acct}")
def last_migration
source_account.migrations.last
end
end

Loading…
Cancel
Save