Sha256: 3df5a285dc2f8956c5c89a0099e7b5c94aa66af0a83cd5a22350d6ff4418ce7e

Contents?: true

Size: 645 Bytes

Versions: 5

Compression:

Stored size: 645 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_following_refresh_tags).with('http://example.com')

          job.perform(scraped_site)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pageflow-chart-1.2.0 spec/jobs/pageflow/chart/scrape_site_job_spec.rb
pageflow-chart-1.1.0 spec/jobs/pageflow/chart/scrape_site_job_spec.rb
pageflow-chart-1.0.1 spec/jobs/pageflow/chart/scrape_site_job_spec.rb
pageflow-chart-1.0.0 spec/jobs/pageflow/chart/scrape_site_job_spec.rb
pageflow-chart-0.2.2 spec/jobs/pageflow/chart/scrape_site_job_spec.rb