Improve test readability

#600
This commit is contained in:
Artur Beljajev 2017-10-04 20:29:08 +03:00
parent 4d41f0ef14
commit d568cc09ae

View file

@ -19,7 +19,7 @@ RSpec.describe 'Registrar current user', db: false do
end end
specify do specify do
make_request get '/registrar/current_user/switch/2', nil, { HTTP_REFERER: 'http://previous.url' }
expect(response).to redirect_to('http://previous.url') expect(response).to redirect_to('http://previous.url')
end end
end end
@ -33,7 +33,7 @@ RSpec.describe 'Registrar current user', db: false do
end end
specify do specify do
make_request get '/registrar/current_user/switch/2'
expect(response).to redirect_to(registrar_login_url) expect(response).to redirect_to(registrar_login_url)
end end
end end
@ -41,13 +41,9 @@ RSpec.describe 'Registrar current user', db: false do
context 'when user is not authenticated' do context 'when user is not authenticated' do
specify do specify do
make_request get '/registrar/current_user/switch/2'
expect(response).to redirect_to(registrar_login_url) expect(response).to redirect_to(registrar_login_url)
end end
end end
def make_request
get '/registrar/current_user/switch/2', nil, { 'HTTP_REFERER' => 'http://previous.url' }
end
end end
end end