diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/authentications_controller_spec.rb | 8 | ||||
-rw-r--r-- | spec/requests/refresh_tokens_controller/post_refresh_tokens_controller_spec.rb (renamed from spec/requests/post_refresh_tokens_spec.rb) | 0 | ||||
-rw-r--r-- | spec/requests/sessions_controller/post_sessions_controller_spec.rb (renamed from spec/requests/authentications_spec.rb) | 4 | ||||
-rw-r--r-- | spec/requests/user_accounts_controller/post_user_accounts_spec.rb (renamed from spec/requests/post_user_accounts_spec.rb) | 0 | ||||
-rw-r--r-- | spec/support/shared_examples/requests/delete_request.rb | 5 |
5 files changed, 7 insertions, 10 deletions
diff --git a/spec/controllers/authentications_controller_spec.rb b/spec/controllers/authentications_controller_spec.rb deleted file mode 100644 index 43e7439..0000000 --- a/spec/controllers/authentications_controller_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe Api::AuthenticationsController, type: :controller do - it { should route(:post, '/api/authenticate').to(action: :create) } - it { should route(:delete, '/api/logout').to(action: :destroy) } -end diff --git a/spec/requests/post_refresh_tokens_spec.rb b/spec/requests/refresh_tokens_controller/post_refresh_tokens_controller_spec.rb index 5d8f8f0..5d8f8f0 100644 --- a/spec/requests/post_refresh_tokens_spec.rb +++ b/spec/requests/refresh_tokens_controller/post_refresh_tokens_controller_spec.rb diff --git a/spec/requests/authentications_spec.rb b/spec/requests/sessions_controller/post_sessions_controller_spec.rb index 6b33402..31cef31 100644 --- a/spec/requests/authentications_spec.rb +++ b/spec/requests/sessions_controller/post_sessions_controller_spec.rb @@ -2,10 +2,10 @@ require 'rails_helper' -RSpec.describe 'POST /api/authenticate', type: :request do +RSpec.describe 'POST /api/login', type: :request do it_behaves_like 'a POST request' do let(:headers) { { 'CONTENT_TYPE' => 'application/json' } } - let(:route) { '/api/authenticate' } + let(:route) { '/api/login' } let(:expected_error_messages) { ['Credenciales incorrectas'] } let(:desired_error_status) { 401 } let(:expected_text) { %w[token refresh] } diff --git a/spec/requests/post_user_accounts_spec.rb b/spec/requests/user_accounts_controller/post_user_accounts_spec.rb index 7c5aacc..7c5aacc 100644 --- a/spec/requests/post_user_accounts_spec.rb +++ b/spec/requests/user_accounts_controller/post_user_accounts_spec.rb diff --git a/spec/support/shared_examples/requests/delete_request.rb b/spec/support/shared_examples/requests/delete_request.rb new file mode 100644 index 0000000..ea921ea --- /dev/null +++ b/spec/support/shared_examples/requests/delete_request.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'a DELETE request' do + let(:headers) { { 'CONTENT_TYPE' => 'application/json' } } +end |