diff options
Diffstat (limited to 'activejob/test/cases/queue_priority_test.rb')
-rw-r--r-- | activejob/test/cases/queue_priority_test.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/activejob/test/cases/queue_priority_test.rb b/activejob/test/cases/queue_priority_test.rb index ca17b51dad..ab4a1bdf7b 100644 --- a/activejob/test/cases/queue_priority_test.rb +++ b/activejob/test/cases/queue_priority_test.rb @@ -1,12 +1,12 @@ -require 'helper' -require 'jobs/hello_job' +require "helper" +require "jobs/hello_job" class QueuePriorityTest < ActiveSupport::TestCase - test 'priority unset by default' do + test "priority unset by default" do assert_equal nil, HelloJob.priority end - test 'uses given priority' do + test "uses given priority" do original_priority = HelloJob.priority begin @@ -17,7 +17,7 @@ class QueuePriorityTest < ActiveSupport::TestCase end end - test 'evals block given to priority to determine priority' do + test "evals block given to priority to determine priority" do original_priority = HelloJob.priority begin @@ -28,19 +28,19 @@ class QueuePriorityTest < ActiveSupport::TestCase end end - test 'can use arguments to determine priority in priority block' do + test "can use arguments to determine priority in priority block" do original_priority = HelloJob.priority begin - HelloJob.queue_with_priority { self.arguments.first=='1' ? 99 : 11 } - assert_equal 99, HelloJob.new('1').priority - assert_equal 11, HelloJob.new('3').priority + HelloJob.queue_with_priority { self.arguments.first=="1" ? 99 : 11 } + assert_equal 99, HelloJob.new("1").priority + assert_equal 11, HelloJob.new("3").priority ensure HelloJob.priority = original_priority end end - test 'uses priority passed to #set' do + test "uses priority passed to #set" do job = HelloJob.set(priority: 123).perform_later assert_equal 123, job.priority end |