Skip to content

Instantly share code, notes, and snippets.

@mfilipe
Created June 26, 2016 17:03
Show Gist options
  • Save mfilipe/c8200a8ed4b96ed45e2146269e55edff to your computer and use it in GitHub Desktop.
Save mfilipe/c8200a8ed4b96ed45e2146269e55edff to your computer and use it in GitHub Desktop.
FactoryGirl.define do
factory :flow do
name "MyString"
daily_send nil
send_on_weekends false
actions [{'when': 'now', 'order': '1', 'template_id': '1234'}]
recipients [{'contact_id': '1234'},
{'first_name': 'Test', 'last_name': 'Last','email': 'user@test.com', 'business': 'Testing'}]
company
user { build :user, company: company }
end
factory :flow_manual_recipient, parent: :flow do
recipients [{'first_name': 'Test', 'last_name': 'Last', 'email': 'user@test.com', 'business': 'Testing'}]
end
factory :flow_base_recipient, parent: :flow do
recipients [{'contact_id': create(:contact, company: company).id },
{'contact_id': create(:contact, company: company).id }]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment