Sha256: 884fac85f3575e0b2d46be3ac37df27c35c6d1de12293d329f511116a1f75571

Contents?: true

Size: 857 Bytes

Versions: 3

Compression:

Stored size: 857 Bytes

Contents

require 'test_helper'

describe Epilicious::Fetcher do
  let(:fetcher) { Epilicious::Fetcher.new }

  context '#fetch_recipes' do
    let(:recipes) { fetcher.fetch_recipes }

    it 'should return a list of recipes' do
      recipes.length.must_equal 15
      recipes.last.must_be_instance_of Epilicious::Recipe
    end
  end

  context '#fetch_recipe' do
    let(:recipe) { fetcher.fetch_recipe }
    it' should return a recipe' do
      recipe.must_be_instance_of Epilicious::Recipe
    end
  end

  context 'private methods' do
    let(:url) { "/articlesguides/bestof/toprecipes/bestburgerrecipes" }
    let(:recipes_page) { fetcher.send(:fetch_page, url) }
                        
    context '#fetch_page' do
      it 'should return a nokogiri document' do
        recipes_page.must_be_instance_of Nokogiri::HTML::Document
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
epilicious-0.1.2 test/fetcher_test.rb
epilicious-0.1.1 test/fetcher_test.rb
epilicious-0.1.0 test/fetcher_test.rb