Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Action View tests to stop re-assigning @output_buffer #45748

Merged

Conversation

casperisfine
Copy link
Contributor

@casperisfine casperisfine commented Aug 3, 2022

Followup on #45745

@rendered is a much better variable for this kind of intermediate result as that's what is used by DOM assertions.

FYI: @jhawthorn, @BlakeWilliams (I'll merge on green)

@rails-bot rails-bot bot added the actionview label Aug 3, 2022
@@ -17,7 +17,7 @@ module Context
# Prepares the context by setting the appropriate instance variables.
def _prepare_context
@view_flow = OutputFlow.new
@output_buffer = nil
@output_buffer = ActionView::OutputBuffer.new
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a test only change, but I think it's for the best. The goal ultimately is to stop swapping the buffer, so ultimately allocating it when the context is allocated will make sense.

@casperisfine casperisfine force-pushed the action-view-refactor-output-buffer-test-2 branch from 08defaa to 2a492b7 Compare August 3, 2022 12:58
Followup on rails#45745

`@rendered` is a much better variable for this kind of intermediate
result as that's what is used by DOM assertions.
@casperisfine casperisfine force-pushed the action-view-refactor-output-buffer-test-2 branch from 2a492b7 to 4b67dff Compare August 3, 2022 13:01
@byroot byroot merged commit d0e26bf into rails:main Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants