Sha256: 18e1c9c3c710efda347864815faa12eba86b1d458a57eeb1aeb13bf3f43f04cb

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

require "spec_helpers"

describe "Staging" do
  let(:url) { test_app_path("git-scm.com/book/en/v2.html") }

  describe Wayfarer::Base do
    specify do
      class self.class::DummyJob < Wayfarer::Base
        extend SpecHelpers

        route { host test_app_host, to: :index }

        def index
          stage page.meta.links.all
        end
      end

      expect {
        self.class::DummyJob.crawl(url)
        perform_enqueued_jobs
      }.to change { enqueued_jobs.size }.by(156)
    end
  end

  describe Wayfarer::Handler do
    specify do
      class self.class::DummyJob < Wayfarer::Base
        extend SpecHelpers

        route do
          host test_app_host, to: DummyHandler
        end

        class DummyHandler < Wayfarer::Handler
          route { to :index }

          def index
            stage page.meta.links.all
          end
        end
      end

      expect {
        self.class::DummyJob.crawl(url)
        perform_enqueued_jobs
      }.to change { enqueued_jobs.size }.by(156)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wayfarer-0.4.6 spec/integration/stage_spec.rb
wayfarer-0.4.5 spec/integration/stage_spec.rb
wayfarer-0.4.4 spec/integration/stage_spec.rb