diff --git a/config/environments/test.rb b/config/environments/test.rb index 73ae40f08..6913ceb7e 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -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 diff --git a/test/models/registrant_verification_test.rb b/test/models/registrant_verification_test.rb index 1950c1ad6..ef4038784 100644 --- a/test/models/registrant_verification_test.rb +++ b/test/models/registrant_verification_test.rb @@ -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