]>
cat aescling's git repositories - mastodon.git/blob - spec/controllers/auth/confirmations_controller_spec.rb
1 # frozen_string_literal: true
5 describe Auth
::ConfirmationsController, type
: :controller do
9 it
'returns http success' do
10 @request.env['devise.mapping'] = Devise
.mappings
[:user]
12 expect(response
).to
have_http_status(200)
16 describe
'GET #show' do
17 context
'when user is unconfirmed' do
18 let!
(:user) { Fabricate(:user, confirmation_token
: 'foobar', confirmed_at
: nil) }
21 allow(BootstrapTimelineWorker
).to
receive(:perform_async)
22 @request.env['devise.mapping'] = Devise
.mappings
[:user]
23 get
:show, params
: { confirmation_token
: 'foobar' }
26 it
'redirects to login' do
27 expect(response
).to
redirect_to(new_user_session_path
)
30 it
'queues up bootstrapping of home timeline' do
31 expect(BootstrapTimelineWorker
).to
have_received(:perform_async).with(user
.account_id
)
35 context
'when user is updating email' do
36 let!
(:user) { Fabricate(:user, confirmation_token
: 'foobar', unconfirmed_email
: 'new-email@example.com') }
39 allow(BootstrapTimelineWorker
).to
receive(:perform_async)
40 @request.env['devise.mapping'] = Devise
.mappings
[:user]
41 get
:show, params
: { confirmation_token
: 'foobar' }
44 it
'redirects to login' do
45 expect(response
).to
redirect_to(new_user_session_path
)
48 it
'does not queue up bootstrapping of home timeline' do
49 expect(BootstrapTimelineWorker
).to_not
have_received(:perform_async)
This page took 0.22057 seconds and 4 git commands to generate.