Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
update scraper spec
  • Loading branch information
aokolish committed Apr 14, 2013
1 parent a1fe333 commit 4b99826
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion Gemfile
Expand Up @@ -32,7 +32,6 @@ group :development, :test do
gem 'factory_girl_rails'
gem 'thin'

# debugging
gem 'pry'
end

Expand Down
14 changes: 8 additions & 6 deletions spec/models/scraper_spec.rb
Expand Up @@ -6,13 +6,15 @@
it "scrapes foodnetwork" do
recipe = scraper.scrape("http://www.foodnetwork.com/example")
recipe.valid?
recipe.title.should eq("Strawberries-and-Cream Tart")
recipe.author.should eq("Recipe courtesy of Food Network Magazine")
recipe.title.should eq("Strawberry Tarts")
recipe.author.should eq("Ina Garten")
recipe.source_url.should eq("http://www.foodnetwork.com/example")
recipe.total_time.should eq("1 hr 25 mins")
recipe.yield.should eq("6-8 servings")
recipe.ingredients.should include("2\ttablespoons vegetable oil\r|1\tlarge egg plus 1 egg yolk")
recipe.directions.should include("Make the crust: Whisk the vegetable oil, egg yolk, milk and vinegar in a bowl. Pulse the flour, baking powder, sugar and salt in a food processor to combine; add the butter and pulse until the mixture looks like coarse meal. Add the milk mixture and pulse once or twice, just to moisten the flour.\r|Transfer the dough")
recipe.total_time.should eq("2 hrs")
recipe.yield.should eq("4 tarts")
recipe.ingredients.should include(
"1 1/4 cups all-purpose flour\r|3 tablespoons sugar\r|1/2 teaspoon kosher salt\r|6 tablespoons")
recipe.directions.should include(
"Combine the flour, sugar, and salt in a small bowl and place in the freezer for 30 minutes.")
end

it "scrapes cookingchanneltv" do
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -40,7 +40,7 @@ def zeus_running?
end

# cache external pages for use in various tests
response = `curl -is http://www.foodnetwork.com/recipes/strawberries-and-cream-tart-recipe/index.html`
response = `curl -is http://www.foodnetwork.com/recipes/ina-garten/strawberry-tarts-recipe/index.html`
FakeWeb.register_uri(:get, "http://www.foodnetwork.com/example", :response => response)

response = `curl -is http://www.cookingchanneltv.com/recipes/monkey-tail-banana-cake-recipe/index.html`
Expand Down

0 comments on commit 4b99826

Please sign in to comment.