mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 15:06:23 +02:00
Corrected test
This commit is contained in:
parent
55848e1000
commit
8b872b4a14
1 changed files with 9 additions and 3 deletions
|
@ -66,13 +66,19 @@ class ReppV1ContactsVerifyTest < ActionDispatch::IntegrationTest
|
|||
assert_emails 0
|
||||
end
|
||||
|
||||
def test_does_not_verify_already_verified_contact
|
||||
def test_reverify_already_verified_contact
|
||||
@contact.update!(verified_at: Time.zone.now - 1.day)
|
||||
post "/repp/v1/contacts/verify/#{@contact.code}", headers: @auth_headers
|
||||
json = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
assert_response :bad_request
|
||||
assert_equal 'Contact already verified', json[:message]
|
||||
assert_response :ok
|
||||
assert_equal 1000, json[:code]
|
||||
assert_equal 'Command completed successfully', json[:message]
|
||||
|
||||
contact = Contact.find_by(code: json[:data][:contact][:code])
|
||||
assert contact.present?
|
||||
assert contact.ident_request_sent_at
|
||||
assert_nil contact.verified_at
|
||||
end
|
||||
|
||||
def test_returns_error_response_if_throttled
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue