1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionmailer/test
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
..
fixtures Expand on Action Mailer Fragment caching tests 2016-04-17 23:16:09 +05:30
mailers Fix AM::Base.default proc arity breaking change 2017-08-29 09:42:28 -04:00
abstract_unit.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03:00
assert_select_email_test.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03:00
asset_host_test.rb Do not generate default alt text in image tags 2017-08-17 16:13:15 -04:00
base_test.rb ActionMailer::Base can unregister observer(s) and interceptor(s). (#32207) 2018-05-30 17:36:24 -04:00
caching_test.rb Replace assert ! with assert_not 2018-04-19 08:11:33 -04:00
delivery_methods_test.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03:00
i18n_with_controller_test.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03:00
log_subscriber_test.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03:00
mail_helper_test.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03:00
mail_layout_test.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03:00
message_delivery_test.rb Enable Layout/SpaceBeforeComma rubocop rule, and fixed more 2017-12-12 20:00:50 +09:00
parameterized_test.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03:00
test_case_test.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03: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
url_test.rb Enable Layout/SpaceBeforeComma rubocop rule, and fixed more 2017-12-12 20:00:50 +09:00