diff options
author | Abdelkader Boudih <terminale@gmail.com> | 2014-08-18 08:17:36 +0000 |
---|---|---|
committer | Abdelkader Boudih <terminale@gmail.com> | 2014-08-18 20:04:02 +0000 |
commit | 68c643f8e70084d89f7bddff2b863b6b83411f4a (patch) | |
tree | 52f0e2107546945452924edae69366f93cc2171e /activejob/test/cases | |
parent | 879dde9b1afbe69e31d355f3197183b99b7a7187 (diff) | |
download | rails-68c643f8e70084d89f7bddff2b863b6b83411f4a.tar.gz rails-68c643f8e70084d89f7bddff2b863b6b83411f4a.tar.bz2 rails-68c643f8e70084d89f7bddff2b863b6b83411f4a.zip |
[ActiveJob] Add queue_name_prefix so all queue are prefixed .
We can split queues on a per environement basis as well as seggregate per application so we can split queues on a per env basis
ActiveJob::Base.queue_name_prefix = 'foo'
Diffstat (limited to 'activejob/test/cases')
-rw-r--r-- | activejob/test/cases/queue_naming_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activejob/test/cases/queue_naming_test.rb b/activejob/test/cases/queue_naming_test.rb index 426af608f0..fdfd1afceb 100644 --- a/activejob/test/cases/queue_naming_test.rb +++ b/activejob/test/cases/queue_naming_test.rb @@ -20,4 +20,19 @@ class QueueNamingTest < ActiveSupport::TestCase HelloJob.queue_name = LoggingJob.queue_name = ActiveJob::Base.default_queue_name end end + + test 'should prefix the queue name' do + begin + original_queue_name_prefix = ActiveJob::Base.queue_name_prefix + original_queue_name = HelloJob.queue_name + + ActiveJob::Base.queue_name_prefix = 'aj' + HelloJob.queue_as :low + assert_equal 'aj_low', HelloJob.queue_name + ensure + ActiveJob::Base.queue_name_prefix = original_queue_name_prefix + HelloJob.queue_name = original_queue_name + end + end + end |