mirror of
https://github.com/internetee/registry.git
synced 2025-06-09 22:24:47 +02:00
added api for accr center
This commit is contained in:
parent
bccd3d51c1
commit
a87fd6a8b7
8 changed files with 191 additions and 0 deletions
16
test/integration/api/accreditation_center/contacts_test.rb
Normal file
16
test/integration/api/accreditation_center/contacts_test.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ContactsTest < ApplicationIntegrationTest
|
||||
def setup
|
||||
super
|
||||
|
||||
@contact = contacts(:john)
|
||||
end
|
||||
|
||||
def test_return_code_error_if_valid_domain_name
|
||||
get "/api/v1/accreditation_center/contacts/?id=Alyosha"
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
assert_equal json[:errors], "Contact not found"
|
||||
end
|
||||
end
|
23
test/integration/api/accreditation_center/domains_test.rb
Normal file
23
test/integration/api/accreditation_center/domains_test.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
require 'test_helper'
|
||||
|
||||
class DomainsTest < ApplicationIntegrationTest
|
||||
def setup
|
||||
super
|
||||
|
||||
@domain = domains(:shop)
|
||||
end
|
||||
|
||||
def test_get_domain_info
|
||||
get "/api/v1/accreditation_center/domains/?name=#{@domain.name}"
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
assert_equal json[:domain][:name], @domain.name
|
||||
end
|
||||
|
||||
def test_return_code_error_if_valid_domain_name
|
||||
get "/api/v1/accreditation_center/domains/?name=some.ee"
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
assert_equal json[:errors], "Domain not found"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue