@@ -200,6 +200,18 @@ def test_assert_enqueued_jobs_with_queue_option
200
200
end
201
201
end
202
202
203
+ def test_assert_enqueued_job_with_priority_option
204
+ assert_enqueued_with ( job : HelloJob , priority : 10 ) do
205
+ HelloJob . set ( priority : 10 ) . perform_later
206
+ end
207
+
208
+ assert_raise ActiveSupport ::TestCase ::Assertion do
209
+ assert_enqueued_with ( job : HelloJob , priority : 10 ) do
210
+ HelloJob . set ( priority : 5 ) . perform_later
211
+ end
212
+ end
213
+ end
214
+
203
215
def test_assert_enqueued_jobs_with_only_option_and_none_sent
204
216
error = assert_raise ActiveSupport ::TestCase ::Assertion do
205
217
assert_enqueued_jobs 1 , only : HelloJob do
@@ -686,7 +698,7 @@ def test_assert_enqueued_with_failure_with_global_id_args
686
698
end
687
699
end
688
700
assert_match ( /No enqueued job found with {:job=>HelloJob, :args=>\[ #{ wilma . inspect } \] }/ , error . message )
689
- assert_match ( /Potential matches: {.*?:job=>HelloJob, :args=>\[ #<Person.* @id="9">\] , :queue=>"default"}/ , error . message )
701
+ assert_match ( /Potential matches: {.*?:job=>HelloJob, :args=>\[ #<Person.* @id="9">\] , :queue=>"default".*? }/ , error . message )
690
702
end
691
703
692
704
def test_assert_enqueued_with_failure_with_no_block_with_global_id_args
@@ -698,7 +710,7 @@ def test_assert_enqueued_with_failure_with_no_block_with_global_id_args
698
710
end
699
711
700
712
assert_match ( /No enqueued job found with {:job=>HelloJob, :args=>\[ #{ wilma . inspect } \] }/ , error . message )
701
- assert_match ( /Potential matches: {.*?:job=>HelloJob, :args=>\[ #<Person.* @id="9">\] , :queue=>"default"}/ , error . message )
713
+ assert_match ( /Potential matches: {.*?:job=>HelloJob, :args=>\[ #<Person.* @id="9">\] , :queue=>"default".*? }/ , error . message )
702
714
end
703
715
704
716
def test_assert_enqueued_with_does_not_change_jobs_count
@@ -1794,6 +1806,18 @@ def test_assert_performed_with_without_block_failure
1794
1806
end
1795
1807
end
1796
1808
1809
+ def test_assert_performed_job_with_priority_option
1810
+ assert_performed_with ( job : HelloJob , priority : 10 ) do
1811
+ HelloJob . set ( priority : 10 ) . perform_later
1812
+ end
1813
+
1814
+ assert_raise ActiveSupport ::TestCase ::Assertion do
1815
+ assert_performed_with ( job : HelloJob , priority : 10 ) do
1816
+ HelloJob . set ( priority : 5 ) . perform_later
1817
+ end
1818
+ end
1819
+ end
1820
+
1797
1821
def test_assert_performed_with_with_at_option
1798
1822
assert_performed_with ( job : HelloJob , at : Date . tomorrow . noon ) do
1799
1823
HelloJob . set ( wait_until : Date . tomorrow . noon ) . perform_later
@@ -1913,7 +1937,7 @@ def test_assert_performed_with_failure_with_global_id_args
1913
1937
end
1914
1938
end
1915
1939
assert_match ( /No performed job found with {:job=>HelloJob, :args=>\[ #{ wilma . inspect } \] }/ , error . message )
1916
- assert_match ( /Potential matches: {.*?:job=>HelloJob, :args=>\[ #<Person.* @id="9">\] , :queue=>"default"}/ , error . message )
1940
+ assert_match ( /Potential matches: {.*?:job=>HelloJob, :args=>\[ #<Person.* @id="9">\] , :queue=>"default".*? }/ , error . message )
1917
1941
end
1918
1942
1919
1943
def test_assert_performed_with_without_block_failure_with_global_id_args
@@ -1926,7 +1950,7 @@ def test_assert_performed_with_without_block_failure_with_global_id_args
1926
1950
end
1927
1951
1928
1952
assert_match ( /No performed job found with {:job=>HelloJob, :args=>\[ #{ wilma . inspect } \] }/ , error . message )
1929
- assert_match ( /Potential matches: {.*?:job=>HelloJob, :args=>\[ #<Person.* @id="9">\] , :queue=>"default"}/ , error . message )
1953
+ assert_match ( /Potential matches: {.*?:job=>HelloJob, :args=>\[ #<Person.* @id="9">\] , :queue=>"default".*? }/ , error . message )
1930
1954
end
1931
1955
1932
1956
def test_assert_performed_with_does_not_change_jobs_count
0 commit comments