From f6e46b8fe6c869bd990a579a4b0ac19fcb3a5aad Mon Sep 17 00:00:00 2001 From: Oleg Hasjanov Date: Thu, 29 Jul 2021 12:50:01 +0300 Subject: [PATCH] change endpoint --- ...login_controller.rb => accreditation_info_controller.rb} | 4 ++-- config/routes.rb | 4 ++-- .../registrar/{login_test.rb => accreditaion_info_test.rb} | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) rename app/controllers/repp/v1/registrar/{login_controller.rb => accreditation_info_controller.rb} (77%) rename test/integration/repp/v1/registrar/{login_test.rb => accreditaion_info_test.rb} (79%) diff --git a/app/controllers/repp/v1/registrar/login_controller.rb b/app/controllers/repp/v1/registrar/accreditation_info_controller.rb similarity index 77% rename from app/controllers/repp/v1/registrar/login_controller.rb rename to app/controllers/repp/v1/registrar/accreditation_info_controller.rb index e487d480e..5859b8acf 100644 --- a/app/controllers/repp/v1/registrar/login_controller.rb +++ b/app/controllers/repp/v1/registrar/accreditation_info_controller.rb @@ -1,8 +1,8 @@ module Repp module V1 module Registrar - class LoginController < BaseController - api :GET, 'repp/v1/registrar/login' + class AccreditationInfoController < BaseController + api :GET, 'repp/v1/registrar/accreditation_info' desc 'check login user and return data' def index diff --git a/config/routes.rb b/config/routes.rb index a7f9b4302..21827911e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -72,9 +72,9 @@ Rails.application.routes.draw do get '/all_notifications', to: 'notifications#all_notifications' end end - resource :login, only: [:index] do + resource :accreditation_info, only: [:index] do collection do - get '/', to: 'login#index' + get '/', to: 'accreditation_info#index' end end resources :nameservers do diff --git a/test/integration/repp/v1/registrar/login_test.rb b/test/integration/repp/v1/registrar/accreditaion_info_test.rb similarity index 79% rename from test/integration/repp/v1/registrar/login_test.rb rename to test/integration/repp/v1/registrar/accreditaion_info_test.rb index d210a7848..c2a23d2c0 100644 --- a/test/integration/repp/v1/registrar/login_test.rb +++ b/test/integration/repp/v1/registrar/accreditaion_info_test.rb @@ -1,6 +1,6 @@ require 'test_helper' -class ReppV1LoginTest < ActionDispatch::IntegrationTest +class ReppV1AccreditationInfoTest < ActionDispatch::IntegrationTest def setup @user = users(:api_bestnames) token = Base64.encode64("#{@user.username}:#{@user.plain_text_password}") @@ -10,7 +10,7 @@ class ReppV1LoginTest < ActionDispatch::IntegrationTest end def test_valid_login - get '/repp/v1/registrar/login', headers: @auth_headers + get '/repp/v1/registrar/accreditation_info', headers: @auth_headers json = JSON.parse(response.body, symbolize_names: true) assert_response :ok @@ -24,7 +24,7 @@ class ReppV1LoginTest < ActionDispatch::IntegrationTest auth_headers = { 'Authorization' => token } - get '/repp/v1/registrar/login', headers: auth_headers + get '/repp/v1/registrar/accreditation_info', headers: auth_headers json = JSON.parse(response.body, symbolize_names: true) assert_response :unauthorized