Skip to content

Instantly share code, notes, and snippets.

@gohuygo
Created November 5, 2012 04:22
Show Gist options
  • Select an option

  • Save gohuygo/4015297 to your computer and use it in GitHub Desktop.

Select an option

Save gohuygo/4015297 to your computer and use it in GitHub Desktop.
factory :restaurant do
name { Faker::Name.first_name }
city
end
factory :matched_restaurant do
association :partner_restaurant
association :restaurant
end
factory :partner_restaurant do
name { Faker::Name.first_name }
end
it "should create a new CheckPrice record when user clicks Check Price on topic page" do
city = create :city, name: "Bilboa", country: create(:country, name: "USA")
partner_restaurant = create :partner_restaurant
restaurant = create :restaurant, name: 'McDonalds', city: city, contact_phone: "123-123-1234"
matched_restaurant = create :matched_restaurant, restaurant: restaurant, partner_restaurant: partner_restaurant
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment