Sha256: 814bb3ccfd2e9595ea922bc6e59d296eb8da9e54bfbb77b49914d933a318facf

Contents?: true

Size: 1012 Bytes

Versions: 9

Compression:

Stored size: 1012 Bytes

Contents

require 'spec_helper'

module Pageflow::Chart
  describe ScrapedSite do
    describe '#csv_url' do
      it 'replaces base filename of url with data.csv' do
        scraped_site = ScrapedSite.new(url: 'http://example.com/foo/index.html')

        expect(scraped_site.csv_url).to eq('http://example.com/foo/data.csv')
      end

      it 'appends data.csv to directory url' do
        scraped_site = ScrapedSite.new(url: 'http://example.com/foo/')

        expect(scraped_site.csv_url).to eq('http://example.com/foo/data.csv')
      end
    end

    it 'copies use_custom_theme flag from config on create' do
      Pageflow::Chart.config.use_custom_theme = true
      scraped_site_with_custom_theme = create(:scraped_site)

      Pageflow::Chart.config.use_custom_theme = false
      scraped_site_without_custom_theme = create(:scraped_site)

      expect(scraped_site_with_custom_theme.use_custom_theme).to eq(true)
      expect(scraped_site_without_custom_theme.use_custom_theme).to eq(false)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pageflow-chart-2.1.0 spec/models/pageflow/chart/scraped_site_spec.rb
pageflow-chart-2.0.0 spec/models/pageflow/chart/scraped_site_spec.rb
pageflow-chart-1.2.0 spec/models/pageflow/chart/scraped_site_spec.rb
pageflow-chart-1.1.0 spec/models/pageflow/chart/scraped_site_spec.rb
pageflow-chart-1.0.1 spec/models/pageflow/chart/scraped_site_spec.rb
pageflow-chart-1.0.0 spec/models/pageflow/chart/scraped_site_spec.rb
pageflow-chart-0.2.2 spec/models/pageflow/chart/scraped_site_spec.rb
pageflow-chart-0.2.1 spec/models/pageflow/chart/scraped_site_spec.rb
pageflow-chart-0.2.0 spec/models/pageflow/chart/scraped_site_spec.rb