mirror of
https://github.com/internetee/registry.git
synced 2025-06-02 18:58:35 +02:00
change endpoint
This commit is contained in:
parent
36e9aac1d3
commit
f6e46b8fe6
3 changed files with 7 additions and 7 deletions
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue