rails/actionmailer/test
Jean Boussier fc0db35fb1 Add OutputBuffer#raw and #capture to reduce the need to swap the buffer
Right now many helpers have to deal with two modes of operation to
capture view output.

The main one is to swap the `@output_buffer` variable with a new buffer.
But since some view implementations such as `builder` keep a reference
on the buffer they were initialized with, this doesn't always work.

So additionally, the various capturing helpers also record the buffer
length prior to executing the block, and then `slice!` the buffer back
to its original size.

This is wasteful and make the code rather unclear.

Now that `OutputBuffer` is a delegator, I'd like to refactor all this
so that:

  - @output_buffer is no longer re-assigned
  - A single OutputBuffer instance is used for the entire response rendering
  - Instead capturing is done through `OutputBuffer#capture`

Once the above is achieved, it should allow us to enabled Erubi's
`:chain_appends` option and get some reduced template size and some
performance.

Not re-assigning `@output_buffer` will also allow template to access
the local variable instead of an instance variable, which is cheaper.

But more importantly, that should make the code easier to understand
and easier to be compatible with `StreamingBuffer`.
2022-08-03 12:56:34 +02:00
..
fixtures Merge pull request #26445 from dracos/multiparty 2020-08-19 10:10:36 -07:00
mailers Return just the address if name is blank 2021-09-16 09:24:27 +02:00
abstract_unit.rb Revert "MethodCallAssertions is a regular player of the team ActiveSupport::TestCase now" 2019-08-02 00:24:21 -04:00
assert_select_email_test.rb Change the empty block style to have space inside of the block 2018-09-25 13:19:35 -04:00
asset_host_test.rb Deprecate starts_with? and ends_with? for String core extensions 2020-05-05 15:51:24 +09:00
base_test.rb Fix some typos. 2022-02-21 17:58:23 +01:00
caching_test.rb Add OutputBuffer#raw and #capture to reduce the need to swap the buffer 2022-08-03 12:56:34 +02:00
delivery_methods_test.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03:00
i18n_with_controller_test.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
log_subscriber_test.rb Remove deprecated ActionMailer::Base.receive in favor of Action Mailbox 2020-05-05 00:06:22 -04:00
mail_helper_test.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
mail_layout_test.rb Use frozen string literal in actionmailer/ 2017-07-23 18:17:19 +03:00
message_delivery_test.rb Add spec to verify that MessageDelivery Job accepts priority 2020-06-22 22:31:15 +05:30
parameterized_test.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
test_case_test.rb Replace ableist language 2021-10-05 22:27:09 -04:00
test_helper_test.rb Remove deprecated ActionMailer::DeliveryJob and ActionMailer::Parameterized::DeliveryJob 2021-11-17 21:51:11 +00:00
url_test.rb Remove method encode from url_test in Actionmailer: 2020-01-08 11:52:13 -03:00