Sha256: 252d423a4218b98550bb04c58bed0d120cbe4fd3e0e8f46a9e75a538b8ad8d10

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

require 'rails_helper'

feature 'requeuing a job that has no params' do
  before do
    Resque.schedule = {
      'job_without_params' => {
        'cron' => '* * * * *',
        'class' => 'JobWithoutParams',
        'args' => {
          'host' => 'localhost'
        },
        'rails_env' => 'test'
      }
    }
    Resque::Scheduler.load_schedule!
  end

  after do
    reset_the_resque_schedule
  end

  # Given I have a job which requires params in the schedule
  # When I press the requeue button
  # Then I should be on the overview page
  # And I should see the job in the queue
  # When I visit the queue page
  # Then I should see the job on the page with the new params
  scenario 'I am prompted to enter the params required for the requeued job' do
    job_name = 'job_without_params'
    queue_name = 'quick'
    job_class = 'JobWithoutParams'

    visit resque_scheduler_engine_routes.schedules_path
    click_button "requeue_job_#{job_name}"

    expect(current_path).to eq ResqueWeb::Engine.app.url_helpers.overview_path
    expect(page).to have_content "#{queue_name} 1"

    find('.queues .queue a', text: queue_name).click

    expect(page).to have_content job_class
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
resque-scheduler-web-0.0.3 spec/features/schedules/requeuing_a_job_without_parameters_spec.rb