Skip to content

Instantly share code, notes, and snippets.

@evizitei
Created May 11, 2010 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evizitei/397593 to your computer and use it in GitHub Desktop.
Save evizitei/397593 to your computer and use it in GitHub Desktop.
class BjJob < ActiveRecord::Base
set_table_name "bj_job"
set_primary_key "bj_job_id"
end
When /^all background jobs have completed$/ do
#bj is not good with timezones, make sure everything will get run
BjJob.all.each{|job| job.update_attributes!(:submitted_at=>12.hours.ago)}
Bj.run
end
Then /^there should be a (pending|finished) background job for "([^\"]*)"$/ do |status,name|
job = BjJob.last
assert_not_nil job.command.to_s.index(name)
assert_equal status,job.state
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment