0
0
Fork 0

Speed-up in Settings:: controllers specs (#27808)

This commit is contained in:
Matt Jankowski 2023-11-10 10:13:42 -05:00 committed by GitHub
parent ac62b995ef
commit 9dc3ce878b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 65 additions and 216 deletions

View file

@ -71,24 +71,22 @@ describe Settings::MigrationsController do
context 'when acct is the current account' do
let(:acct) { user.account }
it 'renders show' do
expect(subject).to render_template :show
end
it 'does not update the moved account', :aggregate_failures do
subject
it 'does not update the moved account' do
expect(user.account.reload.moved_to_account_id).to be_nil
expect(response).to render_template :show
end
end
context 'when target account does not reference the account being moved from' do
let(:acct) { Fabricate(:account, also_known_as: []) }
it 'renders show' do
expect(subject).to render_template :show
end
it 'does not update the moved account', :aggregate_failures do
subject
it 'does not update the moved account' do
expect(user.account.reload.moved_to_account_id).to be_nil
expect(response).to render_template :show
end
end
@ -100,12 +98,11 @@ describe Settings::MigrationsController do
user.account.migrations.create!(acct: moved_to.acct)
end
it 'renders show' do
expect(subject).to render_template :show
end
it 'does not update the moved account', :aggregate_failures do
subject
it 'does not update the moved account' do
expect(user.account.reload.moved_to_account_id).to be_nil
expect(response).to render_template :show
end
end
end