mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 23:54:44 +02:00
Add API/Registrant/Domains route
This commit is contained in:
parent
311aa503b3
commit
0ab9f6333f
4 changed files with 53 additions and 1 deletions
17
app/controllers/api/v1/registrant/domains_controller.rb
Normal file
17
app/controllers/api/v1/registrant/domains_controller.rb
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
require 'rails5_api_controller_backport'
|
||||||
|
|
||||||
|
module Api
|
||||||
|
module V1
|
||||||
|
module Registrant
|
||||||
|
class DomainsController < ActionController::API
|
||||||
|
def index
|
||||||
|
render json: { success: true }
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
render json: { success: true }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -18,6 +18,14 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
mount Repp::API => '/'
|
mount Repp::API => '/'
|
||||||
|
|
||||||
|
namespace :api do
|
||||||
|
namespace :v1 do
|
||||||
|
namespace :registrant do
|
||||||
|
resources :domains, only: [:index, :show], param: :uuid
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# REGISTRAR ROUTES
|
# REGISTRAR ROUTES
|
||||||
namespace :registrar do
|
namespace :registrar do
|
||||||
resource :dashboard
|
resource :dashboard
|
||||||
|
|
12
test/fixtures/domains.yml
vendored
12
test/fixtures/domains.yml
vendored
|
@ -42,10 +42,20 @@ metro:
|
||||||
period_unit: m
|
period_unit: m
|
||||||
uuid: ef97cb80-333b-4893-b9df-163f2b452798
|
uuid: ef97cb80-333b-4893-b9df-163f2b452798
|
||||||
|
|
||||||
|
hospital:
|
||||||
|
name: hospital.test
|
||||||
|
registrar: goodnames
|
||||||
|
registrant: william
|
||||||
|
transfer_code: 23118v2
|
||||||
|
valid_to: 2010-07-05
|
||||||
|
period: 1
|
||||||
|
period_unit: m
|
||||||
|
uuid: 5edda1a5-3548-41ee-8b65-6d60daf85a37
|
||||||
|
|
||||||
invalid:
|
invalid:
|
||||||
name: invalid.test
|
name: invalid.test
|
||||||
transfer_code: 1438d6
|
transfer_code: 1438d6
|
||||||
valid_to: <%= Time.zone.parse('2010-07-05').utc.to_s(:db) %>
|
valid_to: <%= Time.zone.parse('2010-07-05').utc.to_s(:db) %>
|
||||||
registrar: bestnames
|
registrar: bestnames
|
||||||
registrant: invalid
|
registrant: invalid
|
||||||
uuid: 3c430ead-bb17-4b5b-aaa1-caa7dde7e138
|
uuid: 3c430ead-bb17-4b5b-aaa1-caa7dde7e138
|
||||||
|
|
17
test/system/api/registrant/registrant_api_domains_test.rb
Normal file
17
test/system/api/registrant/registrant_api_domains_test.rb
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class RegistrantApiDomainsTest < ApplicationSystemTestCase
|
||||||
|
def setup
|
||||||
|
super
|
||||||
|
|
||||||
|
@registrant = contacts(:william)
|
||||||
|
end
|
||||||
|
|
||||||
|
def teardown
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
def test_can_get_domain_details_by_uuid
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue