2015-02-22 10:11:21 -05:00
|
|
|
if ENV['AJ_ADAPTER'] == 'delayed_job'
|
2014-09-27 08:25:03 -04:00
|
|
|
generate "delayed_job:active_record", "--quiet"
|
2014-08-18 03:19:41 -04:00
|
|
|
end
|
|
|
|
|
2015-09-18 02:07:55 -04:00
|
|
|
rake("db:migrate")
|
|
|
|
|
2014-08-18 03:19:41 -04:00
|
|
|
initializer 'activejob.rb', <<-CODE
|
|
|
|
require "#{File.expand_path("../jobs_manager.rb", __FILE__)}"
|
|
|
|
JobsManager.current_manager.setup
|
|
|
|
CODE
|
|
|
|
|
2015-07-07 15:52:28 -04:00
|
|
|
initializer 'i18n.rb', <<-CODE
|
|
|
|
I18n.available_locales = [:en, :de]
|
|
|
|
CODE
|
|
|
|
|
2014-08-18 03:19:41 -04:00
|
|
|
file 'app/jobs/test_job.rb', <<-CODE
|
|
|
|
class TestJob < ActiveJob::Base
|
|
|
|
queue_as :integration_tests
|
|
|
|
|
|
|
|
def perform(x)
|
|
|
|
File.open(Rails.root.join("tmp/\#{x}"), "w+") do |f|
|
2015-07-07 15:52:28 -04:00
|
|
|
f.write I18n.locale
|
2014-08-18 03:19:41 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
CODE
|