Sha256: 50748a39a0cfeb83a46557f97cd6150ae593a0b29049d9380ec5027fa70a9b2e

Contents?: true

Size: 911 Bytes

Versions: 9

Compression:

Stored size: 911 Bytes

Contents

require 'spec_helper'

module Pageflow
  module Chart
    describe ScrapedSitesController do
      describe '#create' do
        routes { Pageflow::Chart::Engine.routes }

        it 'responds with success' do
          post(:create, scraped_site: {url: "http://example.com/chart.html"}, format: 'json')

          expect(response.status).to eq(201)
        end

        it 'creates scraped site' do
          expect {
            post(:create, scraped_site: {url: "http://example.com/chart.html"}, format: 'json')
          }.to change { ScrapedSite.count }
        end
      end

      describe '#show' do
        routes { Pageflow::Chart::Engine.routes }

        it 'responds with success' do
          scraped_site = create(:scraped_site, state: 'unprocessed')

          get(:show, id: scraped_site.id, format: 'json')

          expect(response.status).to eq(200)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pageflow-chart-1.2.0 spec/controllers/pageflow/chart/scraped_sites_controller_spec.rb
pageflow-chart-1.1.0 spec/controllers/pageflow/chart/scraped_sites_controller_spec.rb
pageflow-chart-1.0.1 spec/controllers/pageflow/chart/scraped_sites_controller_spec.rb
pageflow-chart-1.0.0 spec/controllers/pageflow/chart/scraped_sites_controller_spec.rb
pageflow-chart-0.2.2 spec/controllers/pageflow/chart/scraped_sites_controller_spec.rb
pageflow-chart-0.2.1 spec/controllers/pageflow/chart/scraped_sites_controller_spec.rb
pageflow-chart-0.2.0 spec/controllers/pageflow/chart/scraped_sites_controller_spec.rb
pageflow-chart-0.1.1 spec/controllers/pageflow/chart/scraped_sites_controller_spec.rb
pageflow-chart-0.1.0 spec/controllers/pageflow/chart/scraped_sites_controller_spec.rb