mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 23:54:44 +02:00
refactoring
This commit is contained in:
parent
a87fd6a8b7
commit
ece988fca1
6 changed files with 95 additions and 53 deletions
|
@ -4,13 +4,20 @@ class ContactsTest < ApplicationIntegrationTest
|
|||
def setup
|
||||
super
|
||||
|
||||
@contact = contacts(:john)
|
||||
@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)
|
||||
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
|
||||
assert_equal json[:errors], 'Contact not found'
|
||||
end
|
||||
|
||||
def test_return_code_error_if_sdfsdf
|
||||
get "/api/v1/accreditation_center/contacts/?id=#{@contact.code}"
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
assert_equal json[:contact][:name], 'John'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue