mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 05:05:45 +02:00
Add test to see if registrant verification stores versions
This commit is contained in:
parent
844e613ee1
commit
d95081adcf
2 changed files with 23 additions and 0 deletions
|
@ -27,6 +27,8 @@ Rails.application.configure do
|
|||
# ActionMailer::Base.deliveries array.
|
||||
config.action_mailer.delivery_method = :test
|
||||
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Print deprecation notices to the stderr.
|
||||
config.active_support.deprecation = :stderr
|
||||
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrantVerificationTest < ActiveSupport::TestCase
|
||||
|
||||
setup do
|
||||
@domain = domains(:shop)
|
||||
@initiator = users(:api_bestnames).username
|
||||
@token = 'zzzzz'
|
||||
@domain.update(statuses: [DomainStatus::PENDING_UPDATE],
|
||||
registrant_verification_asked_at: Time.zone.now - 1.day,
|
||||
registrant_verification_token: @token)
|
||||
end
|
||||
|
||||
def test_audit_log
|
||||
registrant_verification = registrant_verifications(:one)
|
||||
random_action = "random#{rand(100)}"
|
||||
|
@ -9,4 +19,15 @@ class RegistrantVerificationTest < ActiveSupport::TestCase
|
|||
registrant_verification.update_attributes!(action: random_action)
|
||||
end
|
||||
end
|
||||
|
||||
def test_reject_changes
|
||||
@registrant_verification = RegistrantVerification.new(domain_id: @domain.id,
|
||||
verification_token: @token)
|
||||
start_versions_count = RegistrantVerificationVersion.count
|
||||
|
||||
assert_nothing_raised do
|
||||
@registrant_verification.domain_registrant_change_reject!("email link, #{@initiator}")
|
||||
end
|
||||
assert_equal RegistrantVerificationVersion.count, start_versions_count + 1
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue