Skip to content

Commit

Permalink
Fix active_record specs
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Sep 5, 2010
1 parent 1815f28 commit df9cf7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions spec/backend/active_record_job_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'spec_helper'
require 'backend/shared_backend_spec'
require 'delayed/backend/shared_spec'
require 'delayed/backend/active_record'

describe Delayed::Backend::ActiveRecord::Job do
Expand All @@ -16,7 +16,7 @@
Time.zone = nil
end

it_should_behave_like 'a backend'
it_should_behave_like 'a delayed_job backend'

context "db_time_now" do
it "should return time in current time zone if set" do
Expand Down
3 changes: 1 addition & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
gem 'activerecord', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']

require 'delayed_job'
require 'sample_jobs'

Delayed::Worker.logger = Logger.new('/tmp/dj.log')
RAILS_ENV = 'test'
Expand All @@ -28,4 +27,4 @@
Delayed::Worker.backend = BACKENDS.first

# Add this directory so the ActiveSupport autoloading works
ActiveSupport::Dependencies.load_paths << File.dirname(__FILE__)
ActiveSupport::Dependencies.autoload_paths << File.dirname(__FILE__)
2 changes: 1 addition & 1 deletion spec/worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def job_create(opts = {})
@worker.run(@job)
@job.reload
@job.last_error.should =~ /did not work/
@job.last_error.should =~ /sample_jobs.rb:8:in `perform'/
@job.last_error.should =~ /sample_jobs.rb:\d+:in `perform'/
@job.attempts.should == 1
@job.run_at.should > Delayed::Job.db_time_now - 10.minutes
@job.run_at.should < Delayed::Job.db_time_now + 10.minutes
Expand Down

0 comments on commit df9cf7e

Please sign in to comment.