Skip to content

Commit

Permalink
change endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Jul 29, 2021
1 parent 8524ebf commit bef6594
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@
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
Expand Down
Original file line number Diff line number Diff line change
@@ -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}")
Expand All @@ -10,7 +10,7 @@ def setup
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
Expand Down

0 comments on commit bef6594

Please sign in to comment.