refactor login user calls
This commit is contained in:
parent
8c962e5c99
commit
de326e5505
1 changed files with 2 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue