blob: 31cef31e5cef8a49f78f00e843ca77817f0fc302 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'POST /api/login', type: :request do
it_behaves_like 'a POST request' do
let(:headers) { { 'CONTENT_TYPE' => 'application/json' } }
let(:route) { '/api/login' }
let(:expected_error_messages) { ['Credenciales incorrectas'] }
let(:desired_error_status) { 401 }
let(:expected_text) { %w[token refresh] }
let(:user) { create(:user_account) }
let(:params) { { credentials: { email: user.email, password: user.password } } }
let(:wrong_params) { { credentials: { email: user.email, password: 'wrong_password' } } }
end
end
|