Created
May 11, 2010 17:49
-
-
Save evizitei/397593 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BjJob < ActiveRecord::Base | |
set_table_name "bj_job" | |
set_primary_key "bj_job_id" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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