Module: ActionMailer::TestCase::Behavior
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::ActiveSupport::Concern
|
|
Instance Chain:
self,
Rails::Dom::Testing::Assertions::DomAssertions,
Rails::Dom::Testing::Assertions::SelectorAssertions,
::ActionMailer::TestHelper ,
::ActiveJob::TestHelper ,
::ActiveSupport::Testing::Assertions ,
::ActiveSupport::Testing::ConstantLookup
|
|
Defined in: | actionmailer/lib/action_mailer/test_case.rb |
Class Method Summary
::ActiveSupport::Concern
- Extended
class_methods | Define class methods from given block. |
included | Evaluate given block in context of base class, so that you can write class macros here. |
prepended | Evaluate given block in context of base class, so that you can write class macros here. |
Instance Attribute Summary
::ActiveJob::TestHelper
- Included
Instance Method Summary
-
#read_fixture(action)
Reads the fixture file for the given mailer.
::ActionMailer::TestHelper
- Included
#assert_emails | Asserts that the number of emails sent matches the given number. |
#assert_enqueued_email_with | Asserts that a specific email has been enqueued, optionally matching arguments and/or params. |
#assert_enqueued_emails | Asserts that the number of emails enqueued for later delivery matches the given number. |
#assert_no_emails | Asserts that no emails have been sent. |
#assert_no_enqueued_emails | Asserts that no emails are enqueued for later delivery. |
#capture_emails | Returns any emails that are sent in the block. |
#deliver_enqueued_emails | Delivers all enqueued emails. |
::ActiveJob::TestHelper
- Included
#assert_enqueued_jobs | Asserts that the number of enqueued jobs matches the given number. |
#assert_enqueued_with | Asserts that the job has been enqueued with the given arguments. |
#assert_no_enqueued_jobs | Asserts that no jobs have been enqueued. |
#assert_no_performed_jobs | Asserts that no jobs have been performed. |
#assert_performed_jobs | Asserts that the number of performed jobs matches the given number. |
#assert_performed_with | Asserts that the job has been performed with the given arguments. |
#perform_enqueued_jobs | Performs all enqueued jobs. |
#queue_adapter | Accesses the queue_adapter set by |
#queue_adapter_for_test | Returns a queue adapter instance to use with all Active Job test helpers. |
::ActiveSupport::Testing::Assertions
- Included
#assert_changes | Assertion that the result of evaluating an expression is changed before and after invoking the passed in block. |
#assert_difference | Test numeric difference between the return value of an expression as a result of what is evaluated in the yielded block. |
#assert_no_changes | Assertion that the result of evaluating an expression is not changed before and after invoking the passed in block. |
#assert_no_difference | Assertion that the numeric result of evaluating an expression is not changed before and after invoking the passed in block. |
#assert_not | Asserts that an expression is not truthy. |
#assert_nothing_raised | Assertion that the block should not raise an exception. |
#assert_raise | |
#assert_raises | Asserts that a block raises one of |
DSL Calls
included
[ GitHub ]40 41 42 43 44 45 46
# File 'actionmailer/lib/action_mailer/test_case.rb', line 40
included do class_attribute :_mailer_class setup :initialize_test_deliveries setup :set_expected_mail teardown :restore_test_deliveries ActiveSupport.run_load_hooks(:action_mailer_test_case, self) end
Instance Method Details
#read_fixture(action)
Reads the fixture file for the given mailer.
This is useful when testing mailers by being able to write the body of an email inside a fixture. See the testing guide for a concrete example: guides.rubyonrails.org/testing.html#revenge-of-the-fixtures