From b6a99188c2a7f6fa65d96bb1080b1b6cb1f5be20 Mon Sep 17 00:00:00 2001 From: mmeest Date: Tue, 1 Jul 2025 16:36:38 +0300 Subject: [PATCH] added new tests --- .../api/accreditation_center/contacts_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/integration/api/accreditation_center/contacts_test.rb b/test/integration/api/accreditation_center/contacts_test.rb index 0770d663e..996883f54 100644 --- a/test/integration/api/accreditation_center/contacts_test.rb +++ b/test/integration/api/accreditation_center/contacts_test.rb @@ -20,4 +20,20 @@ class ContactsTest < ApplicationIntegrationTest assert_equal json[:contact][:name], 'John' end + + def test_parameter_missing_error + get '/api/v1/accreditation_center/contacts' # without name parameter + json = JSON.parse(response.body, symbolize_names: true) + + assert_response 404 + assert_equal 'Contact not found', json[:errors] + end + + def test_record_not_found_error + get '/api/v1/accreditation_center/contacts/?id=non_existent' + json = JSON.parse(response.body, symbolize_names: true) + + assert_response 404 + assert_equal 'Contact not found', json[:errors] + end end