Sha256: bb7f1f0e637dc43c91769db3eadd7a70301b51ed99222d007dfd3ec892426721

Contents?: true

Size: 622 Bytes

Versions: 4

Compression:

Stored size: 622 Bytes

Contents

require 'spec_helper'

module Pageflow
  module Chart
    describe ScrapeSiteJob do
      describe '#perform' do
        it 'scrapes html' do
          scraper = double("Scraper", html: '<html>rewritten</html>')
          downloader = double("Downloader", load: '<html>original</html>')
          job = ScrapeSiteJob.new(downloader)
          scraped_site = create(:scraped_site, url: 'http://example.com')

          allow(Scraper).to receive(:new).and_return(scraper)

          expect(downloader).to receive(:load).with('http://example.com')

          job.perform(scraped_site)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pageflow-chart-0.2.1 spec/jobs/pageflow/chart/scrape_site_job_spec.rb
pageflow-chart-0.2.0 spec/jobs/pageflow/chart/scrape_site_job_spec.rb
pageflow-chart-0.1.1 spec/jobs/pageflow/chart/scrape_site_job_spec.rb
pageflow-chart-0.1.0 spec/jobs/pageflow/chart/scrape_site_job_spec.rb