internetee-registry/test/integration/api/accreditation_center/contacts_test.rb
2021-11-08 12:16:58 +02:00

23 lines
588 B
Ruby

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
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