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/cases
bogdanvlviv 4382fcbc22
Allow call assert_enqueued_with and assert_enqueued_email_with with no block
Example of `assert_enqueued_with` with no block
```ruby
def test_assert_enqueued_with
  MyJob.perform_later(1,2,3)
  assert_enqueued_with(job: MyJob, args: [1,2,3], queue: 'low')

  MyJob.set(wait_until: Date.tomorrow.noon).perform_later
  assert_enqueued_with(job: MyJob, at: Date.tomorrow.noon)
end
```

Example of `assert_enqueued_email_with` with no block:
```ruby
def test_email
  ContactMailer.welcome.deliver_later
  assert_enqueued_email_with ContactMailer, :welcome
end

def test_email_with_arguments
  ContactMailer.welcome("Hello", "Goodbye").deliver_later
  assert_enqueued_email_with ContactMailer, :welcome, args: ["Hello", "Goodbye"]
end
```

Related to #33243
2018-06-29 15:37:02 +03:00
..
adapter_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
argument_serialization_test.rb Merge pull request #32026 from bogdanvlviv/improve-30941 2018-02-20 13:35:34 -05:00
callbacks_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
exceptions_test.rb Allow passing multiple exceptions to retry_on/discard_on 2018-06-25 18:16:58 -04:00
job_serialization_test.rb Make sure that when serialing an just deserialized job arguments are there 2018-05-01 13:33:50 -04:00
logging_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
queue_adapter_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
queue_naming_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
queue_priority_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
queuing_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
rescue_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
serializers_test.rb Fix error message about unknown ActiveJob argument serializer 2018-02-17 17:48:10 +02:00
test_case_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
test_helper_test.rb Allow call assert_enqueued_with and assert_enqueued_email_with with no block 2018-06-29 15:37:02 +03:00
timezones_test.rb Add support for timezones to Active Job 2018-02-22 14:14:42 +00:00
translation_test.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00