1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/test/support/integration/dummy_app_template.rb
Andrew White 2e501ac9c4 Run rake db:migrate for all Active Job integration tests
If db/schema.rb doesn't exist then we get warnings from the dummy Rails
application so run it for all adapters even if they're not using the
database to store jobs.
2015-09-21 14:02:41 +01:00

26 lines
548 B
Ruby

if ENV['AJ_ADAPTER'] == 'delayed_job'
generate "delayed_job:active_record", "--quiet"
end
rake("db:migrate")
initializer 'activejob.rb', <<-CODE
require "#{File.expand_path("../jobs_manager.rb", __FILE__)}"
JobsManager.current_manager.setup
CODE
initializer 'i18n.rb', <<-CODE
I18n.available_locales = [:en, :de]
CODE
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|
f.write I18n.locale
end
end
end
CODE