]> cat aescling's git repositories - mastodon.git/blob - spec/controllers/auth/confirmations_controller_spec.rb
Default follows for new users (#4871)
[mastodon.git] / spec / controllers / auth / confirmations_controller_spec.rb
1 # frozen_string_literal: true
2
3 require 'rails_helper'
4
5 describe Auth::ConfirmationsController, type: :controller do
6 describe 'GET #new' do
7 it 'returns http success' do
8 @request.env['devise.mapping'] = Devise.mappings[:user]
9 get :new
10 expect(response).to have_http_status(:success)
11 end
12 end
13
14 describe 'GET #show' do
15 let!(:user) { Fabricate(:user, confirmation_token: 'foobar', confirmed_at: nil) }
16
17 before do
18 allow(BootstrapTimelineWorker).to receive(:perform_async)
19 @request.env['devise.mapping'] = Devise.mappings[:user]
20 get :show, params: { confirmation_token: 'foobar' }
21 end
22
23 it 'redirects to login' do
24 expect(response).to redirect_to(new_user_session_path)
25 end
26
27 it 'queues up bootstrapping of home timeline' do
28 expect(BootstrapTimelineWorker).to have_received(:perform_async).with(user.account_id)
29 end
30 end
31 end
This page took 0.084735 seconds and 4 git commands to generate.