Sha256: 84b61578da2b9a672ba87c07870ba5dae6b50f1679c356a8518409cbf95c77cc

Contents?: true

Size: 726 Bytes

Versions: 23

Compression:

Stored size: 726 Bytes

Contents

require 'spec_helper'

module Scrapers

  describe AllRecipes do
    it{should respond_to :scrape}
    context "scraping" do
      before(:all) do
        @url = "http://allrecipes.com/recipe/morning-glory-muffins-i/detail.aspx"
        @recipe = VCR.use_cassette('allrecipes.morning-glory-muffins-i') do
          Scrapers::AllRecipes.scrape(@url)
        end
      end
      
      it "retrieves a recipe" do
        @recipe.should_not be_nil
      end
      it "should be a Hash" do
        @recipe.should be_a(Hash)
      end
      %w{title url ingredients directions photo}.map(&:to_sym).each do |key|
        it "should have key #{key}" do
          @recipe.should have_key(key)
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
scrapers-2.1.0 spec/scrapers/allrecipes_spec.rb
scrapers-2.0.2 spec/scrapers/allrecipes_spec.rb
scrapers-2.0.1 spec/scrapers/allrecipes_spec.rb
scrapers-2.0.0 spec/scrapers/allrecipes_spec.rb
scrapers-1.5.6 spec/scrapers/allrecipes_spec.rb
scrapers-1.5.5 spec/scrapers/allrecipes_spec.rb
scrapers-1.5.4 spec/scrapers/allrecipes_spec.rb
scrapers-1.5.3 spec/scrapers/allrecipes_spec.rb
scrapers-1.5.2 spec/scrapers/allrecipes_spec.rb
scrapers-1.5.1 spec/scrapers/allrecipes_spec.rb
scrapers-1.5.0 spec/scrapers/allrecipes_spec.rb
scrapers-1.4.0 spec/scrapers/allrecipes_spec.rb
scrapers-1.3.0 spec/scrapers/allrecipes_spec.rb
scrapers-1.2.0 spec/scrapers/allrecipes_spec.rb
scrapers-1.1.0 spec/scrapers/allrecipes_spec.rb
scrapers-1.0.0 spec/scrapers/allrecipes_spec.rb
scrapers-0.4.3 spec/scrapers/allrecipes_spec.rb
scrapers-0.4.2 spec/scrapers/allrecipes_spec.rb
scrapers-0.4.1 spec/scrapers/allrecipes_spec.rb
scrapers-0.4.0 spec/scrapers/allrecipes_spec.rb