Skip to content

Instantly share code, notes, and snippets.

@emilevictor
Created May 1, 2013 05:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emilevictor/a376231cf11345b35e1b to your computer and use it in GitHub Desktop.
Save emilevictor/a376231cf11345b35e1b to your computer and use it in GitHub Desktop.
sites.rb
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :site, class: 'Site' do
name "MyString"
organisation_category nil
service_type_organisation_category_id 1
telephone "MyString"
fax "MyString"
email "MyString"
url "MyString"
clinical_software_package_id 1
billing_software_package_id 1
bulk_billing false
disabled_access false
ncacch false
parking false
organisation nil
factory :site_with_addresses do
ignore do
addresses_count 1
end
before(:create) do |site, evaluator|
FactoryGirl.create_list(:site_address, evaluator.addresses_count, addressee: site)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment