|
|
|
|
@ -5,17 +5,11 @@ require 'rails_helper'
|
|
|
|
|
RSpec.describe Settings::MigrationsController do |
|
|
|
|
render_views |
|
|
|
|
|
|
|
|
|
shared_examples 'authenticate user' do |
|
|
|
|
it 'redirects to sign_in page' do |
|
|
|
|
expect(subject).to redirect_to new_user_session_path |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
describe 'GET #show' do |
|
|
|
|
context 'when user is not sign in' do |
|
|
|
|
subject { get :show } |
|
|
|
|
|
|
|
|
|
it_behaves_like 'authenticate user' |
|
|
|
|
it { is_expected.to redirect_to new_user_session_path } |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'when user is sign in' do |
|
|
|
|
@ -49,7 +43,7 @@ RSpec.describe Settings::MigrationsController do
|
|
|
|
|
context 'when user is not sign in' do |
|
|
|
|
subject { post :create } |
|
|
|
|
|
|
|
|
|
it_behaves_like 'authenticate user' |
|
|
|
|
it { is_expected.to redirect_to new_user_session_path } |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context 'when user is signed in' do |
|
|
|
|
|