summaryrefslogtreecommitdiff
path: root/spec/requests/sessions_controller/create_spec.rb
blob: cca04b1cbf7d200db2998580fec9902ac4199c4e (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) { {} }
    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) { { email: user.email, password: user.password } }
    let(:wrong_params) { { email: user.email, password: 'wrong_password' } }
  end
end