setup_controller_spec.rb 538 B

12345678910111213141516171819202122232425
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe Auth::SetupController do
  4. render_views
  5. describe 'GET #show' do
  6. context 'with a signed out request' do
  7. it 'returns http redirect' do
  8. get :show
  9. expect(response).to be_redirect
  10. end
  11. end
  12. context 'with an unconfirmed signed in user' do
  13. before { sign_in Fabricate(:user, confirmed_at: nil) }
  14. it 'returns http success' do
  15. get :show
  16. expect(response).to have_http_status(200)
  17. end
  18. end
  19. end
  20. end