Sha256: 0d4dfd0df0b2875dbafebf1cdfcddb8f15bed79eabf5c483f9a40d29c260ee0f

Contents?: true

Size: 1.19 KB

Versions: 9

Compression:

Stored size: 1.19 KB

Contents

$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'bundler/setup'
require 'logger'

require 'rails'
require 'action_mailer'
require 'active_support/dependencies'
require 'active_record'

require 'delayed_job'
require 'delayed/backend/shared_spec'

Delayed::Worker.logger = Logger.new('/tmp/dj.log')
ENV['RAILS_ENV'] = 'test'

Delayed::Worker.backend = :test

# Add this directory so the ActiveSupport autoloading works
ActiveSupport::Dependencies.autoload_paths << File.dirname(__FILE__)

# Add this to simulate Railtie initializer being executed
ActionMailer::Base.send(:extend, Delayed::DelayMail)


# Used to test interactions between DJ and an ORM
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => ':memory:'
ActiveRecord::Base.logger = Delayed::Worker.logger
ActiveRecord::Migration.verbose = false

ActiveRecord::Schema.define do
  create_table :stories, :primary_key => :story_id, :force => true do |table|
    table.string :text
    table.boolean :scoped, :default => true
  end
end

class Story < ActiveRecord::Base
  set_primary_key :story_id
  def tell; text; end
  def whatever(n, _); tell*n; end
  default_scope where(:scoped => true)

  handle_asynchronously :whatever
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
delayed_job_unique_key-0.0.4 spec/spec_helper.rb
delayed_job-3.0.1 spec/spec_helper.rb
delayed_job-3.0.0 spec/spec_helper.rb
delayed_job_unique_key-0.0.3 spec/spec_helper.rb
delayed_job_unique_key-0.0.2 spec/spec_helper.rb
delayed_job_unique_key-0.0.1 spec/spec_helper.rb
delayed_job-3.0.0.pre4 spec/spec_helper.rb
delayed_job-3.0.0.pre3 spec/spec_helper.rb
delayed_job-3.0.0.pre2 spec/spec_helper.rb