8_increase_test_coverage_controllers #36

Merged
philipp merged 5 commits from 8_increase_test_coverage_controllers into develop 2023-01-05 13:44:21 +01:00
Showing only changes of commit de326e5505 - Show all commits

View file

@ -186,15 +186,15 @@ describe 'Auth concern', type: :controller do
let(:token_msg) { token_verifier.generate }
let(:user) { create :user }
before { login user }
it 'authenticates token' do
login user
routes.draw { get 'try_authenticate_or_token' => 'dummy_auth#try_authenticate_or_token' }
get_with_defaults :try_authenticate_or_token, params: { token: token_msg }
expect(response).not_to have_http_status(:redirect)
end
it 'redirects on faulty token' do
login user
routes.draw { get 'try_authenticate_or_token' => 'dummy_auth#try_authenticate_or_token' }
get_with_defaults :try_authenticate_or_token, params: { token: 'abc' }
expect(response).to have_http_status(:redirect)
@ -203,7 +203,6 @@ describe 'Auth concern', type: :controller do
end
it 'authenticates current user on empty token' do
login user
routes.draw { get 'try_authenticate_or_token' => 'dummy_auth#try_authenticate_or_token' }
get_with_defaults :try_authenticate_or_token
expect(response).to have_http_status(:success)