mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 03:30:33 +02:00
Merge remote-tracking branch 'origin/master' into 1422-record-payment-method-and-failed-payments
This commit is contained in:
commit
5d999f96c5
75 changed files with 847 additions and 782 deletions
|
@ -5,7 +5,7 @@ class ContactAuditLogTest < ActionDispatch::IntegrationTest
|
|||
contact = contacts(:john)
|
||||
|
||||
contact.legal_document_id = 1
|
||||
assert_difference 'contact.versions.count' do
|
||||
assert_difference 'contact.versions.count', 1 do
|
||||
contact.save!
|
||||
end
|
||||
|
||||
|
@ -13,4 +13,4 @@ class ContactAuditLogTest < ActionDispatch::IntegrationTest
|
|||
assert_equal ({ legal_documents: [1] }).with_indifferent_access,
|
||||
contact_version.children.with_indifferent_access
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ class DomainAuditLogTest < ActionDispatch::IntegrationTest
|
|||
assert_equal registrant_id, domain.registrant_id
|
||||
domain.legal_document_id = legal_document_id
|
||||
|
||||
assert_difference 'domain.versions.count' do
|
||||
assert_difference 'domain.versions.count', 1 do
|
||||
domain.save!
|
||||
end
|
||||
|
||||
|
@ -26,4 +26,4 @@ class DomainAuditLogTest < ActionDispatch::IntegrationTest
|
|||
assert_equal [legal_document_id], domain_version.children['legal_documents']
|
||||
assert_equal [registrant_id], domain_version.children['registrant']
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegenerateRegistrarReferenceNumbersTaskTest < ActiveSupport::TestCase
|
||||
def test_regenerates_registrar_reference_numbers_to_estonian_format
|
||||
registrar = registrars(:bestnames)
|
||||
registrar.update_column(:reference_no, 'RF1111')
|
||||
|
||||
capture_io { run_task }
|
||||
registrar.reload
|
||||
|
||||
assert_not registrar.reference_no.start_with?('RF')
|
||||
end
|
||||
|
||||
def test_bypasses_registrar_validation
|
||||
registrar = registrars(:invalid)
|
||||
registrar.update_column(:reference_no, 'RF1111')
|
||||
assert registrar.invalid?
|
||||
|
||||
capture_io { run_task }
|
||||
registrar.reload
|
||||
|
||||
assert_not registrar.reference_no.start_with?('RF')
|
||||
end
|
||||
|
||||
def test_does_not_regenerate_when_the_task_is_run_again
|
||||
registrar = registrars(:bestnames)
|
||||
registrar.update!(reference_no: '1111')
|
||||
|
||||
capture_io { run_task }
|
||||
registrar.reload
|
||||
|
||||
assert_equal '1111', registrar.reference_no
|
||||
end
|
||||
|
||||
def test_keeps_iso_reference_number_on_the_invoice_unchanged
|
||||
registrar = registrars(:bestnames)
|
||||
registrar.update_column(:reference_no, 'RF1111')
|
||||
invoice = invoices(:one)
|
||||
invoice.update!(reference_no: 'RF2222')
|
||||
|
||||
capture_io { run_task }
|
||||
invoice.reload
|
||||
|
||||
assert_equal 'RF2222', invoice.reference_no
|
||||
end
|
||||
|
||||
def test_output
|
||||
registrar = registrars(:bestnames)
|
||||
registrar.update_column(:reference_no, 'RF1111')
|
||||
|
||||
assert_output "Registrars processed: 1\n" do
|
||||
run_task
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def run_task
|
||||
Rake::Task['data_migrations:regenerate_registrar_reference_numbers'].execute
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue