Combine shared-setup examples across spec/controllers/auth/* specs (#32906)

This commit is contained in:
Matt Jankowski 2024-11-15 11:07:26 -05:00 committed by GitHub
parent 54a7c1898e
commit 7bd7705f59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 121 additions and 124 deletions

View file

@ -23,12 +23,11 @@ RSpec.describe Auth::ConfirmationsController do
get :show, params: { confirmation_token: 'foobar' }
end
it 'redirects to login' do
expect(response).to redirect_to(new_user_session_path)
end
it 'queues up bootstrapping of home timeline' do
expect(BootstrapTimelineWorker).to have_received(:perform_async).with(user.account_id)
it 'redirects to login and queues worker' do
expect(response)
.to redirect_to(new_user_session_path)
expect(BootstrapTimelineWorker)
.to have_received(:perform_async).with(user.account_id)
end
end
@ -88,13 +87,13 @@ RSpec.describe Auth::ConfirmationsController do
get :show, params: { confirmation_token: 'foobar' }
end
it 'redirects to login and confirms email' do
expect(response).to redirect_to(new_user_session_path)
expect(user.reload.unconfirmed_email).to be_nil
end
it 'does not queue up bootstrapping of home timeline' do
expect(BootstrapTimelineWorker).to_not have_received(:perform_async)
it 'redirects to login, confirms email, does not queue worker' do
expect(response)
.to redirect_to(new_user_session_path)
expect(user.reload.unconfirmed_email)
.to be_nil
expect(BootstrapTimelineWorker)
.to_not have_received(:perform_async)
end
end
end