Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (30 sloc) 1.105 kb
require 'spec_helper'
require 'delayed/backend/active_record'
describe Delayed::Backend::ActiveRecord::Job do
after do
Time.zone = nil
end
it_should_behave_like 'a delayed_job backend'
context "db_time_now" do
it "should return time in current time zone if set" do
Time.zone = 'Eastern Time (US & Canada)'
%w(EST EDT).should include(Delayed::Job.db_time_now.zone)
end
it "should return UTC time if that is the AR default" do
Time.zone = nil
ActiveRecord::Base.default_timezone = :utc
Delayed::Backend::ActiveRecord::Job.db_time_now.zone.should == 'UTC'
end
it "should return local time if that is the AR default" do
Time.zone = 'Central Time (US & Canada)'
ActiveRecord::Base.default_timezone = :local
%w(CST CDT).should include(Delayed::Backend::ActiveRecord::Job.db_time_now.zone)
end
end
describe "after_fork" do
it "should call reconnect on the connection" do
ActiveRecord::Base.connection.should_receive(:reconnect!)
Delayed::Backend::ActiveRecord::Job.after_fork
end
end
end
Jump to Line
Something went wrong with that request. Please try again.