Genshin/GAKUEngine

View on GitHub
core/lib/gaku/testing/factories/contact_creation_factory.rb

Summary

Maintainability
A
0 mins
Test Coverage
FactoryBot.define do
  factory :contact_creation, class: Gaku::ContactCreation do
    data { 'gaku@example.com' }
    details { 'My email' }
    contact_type

    initialize_with { new(attributes) }

    after(:build) do |contact_creation|
      if contact_creation.contact.contactable.respond_to?(:contacts)
        contact_creation.contact.contactable.contacts.reload
      end
    end
  end
end