Sha256: f62399251de4e2318d89dc8505106e2e19503024cb6bf29aaa1e9f53e483092e

Contents?: true

Size: 960 Bytes

Versions: 4

Compression:

Stored size: 960 Bytes

Contents

When /^I run the delayed jobs$/ do
  unless @resque_worker
    @resque_worker = Resque::Worker.new("ts_delta")
    @resque_worker.register_worker
  end
  while job = @resque_worker.reserve
    @resque_worker.perform(job)
  end
end

When /^I run one delayed job$/ do
  unless @resque_worker
    @resque_worker = Resque::Worker.new("ts_delta")
    @resque_worker.register_worker
  end
  job = @resque_worker.reserve
  @resque_worker.perform(job)
end

When /^I cancel the jobs$/ do
  ThinkingSphinx::Deltas::SidekiqDelta.clear!
end

When /^I change the name of delayed beta (\w+) to (\w+)$/ do |current, replacement|
  DelayedBeta.find_by_name(current).update_attributes(:name => replacement)
end

Then /^there should be no more DeltaJobs on the Resque queue$/ do
  job_classes = Resque.redis.lrange("queue:ts_delta", 0, -1).collect do |j|
    Resque.decode(j)["class"]
  end
  job_classes.should_not include("ThinkingSphinx::Deltas::SidekiqDelta::DeltaJob")
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ts-sidekiq-delta-0.4.0 features/step_definitions/sidekiq_delta_steps.rb
ts-sidekiq-delta-0.3.0 features/step_definitions/sidekiq_delta_steps.rb
ts-sidekiq-delta-0.2.0 features/step_definitions/sidekiq_delta_steps.rb
ts-sidekiq-delta-0.1.0 features/step_definitions/sidekiq_delta_steps.rb