mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Add tests, show papertrail whodunnit properly on repp api
This commit is contained in:
parent
7d08e22f6f
commit
38f86225ca
3 changed files with 28 additions and 3 deletions
|
@ -101,4 +101,19 @@ class ReppV1ContactsUpdateTest < ActionDispatch::IntegrationTest
|
|||
@contact.reload
|
||||
assert @contact.legal_documents.any?
|
||||
end
|
||||
|
||||
def test_returns_error_if_ident_wrong_format
|
||||
request_body = {
|
||||
"contact": {
|
||||
"ident": "123"
|
||||
}
|
||||
}
|
||||
|
||||
put "/repp/v1/contacts/#{@contact.code}", headers: @auth_headers, params: request_body
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
assert_response :bad_request
|
||||
assert_equal 2308, json[:code]
|
||||
assert_equal 'Ident update is not allowed. Consider creating new contact object', json[:message]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue