Add tests

This commit is contained in:
Artur Beljajev 2019-03-04 15:26:25 +02:00
parent 647bf4c397
commit 6bab335f5a
4 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,16 @@
require 'test_helper'
class ContactAuditLogTest < ActionDispatch::IntegrationTest
def test_stores_metadata
contact = contacts(:john)
contact.legal_document_id = 1
assert_difference 'contact.versions.count' do
contact.save!
end
contact_version = contact.versions.last
assert_equal ({ legal_documents: [1] }).with_indifferent_access,
contact_version.children.with_indifferent_access
end
end