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

Stop using deprecated render :text in test #20923

Merged
merged 1 commit into from
Jul 18, 2015

Conversation

sikachu
Copy link
Member

@sikachu sikachu commented Jul 18, 2015

This will silence deprecation warnings when running test suite.

Most of the test can be changed from render :text to render :plain or render :body right away. However, there are some tests that needed to be fixed by hand as they actually assert the default Content-Type returned from render :body.

# variant.any(:tablet, :phablet){ render text: "any" }
# variant.phone { render text: "phone" }
# variant.any(:tablet, :phablet){ render body: "any" }
# variant.phone { render body: "phone" }
Copy link
Member

Choose a reason for hiding this comment

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

Would avoid using the body: option in docs. Makes sense to use plain: if we're rendering text.

Copy link
Member Author

Choose a reason for hiding this comment

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

plain: actually forces text/plain (i.e. it does not care if it's overridden by respond_to block)

I have a mixed feeling after I found out about that, but it has to be body: in this example.

Copy link
Member

Choose a reason for hiding this comment

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

Ah right, due to the respond_to blocks. Maybe using html: is clearer, then.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@sikachu sikachu force-pushed the silence-render-text-warning branch from 01e32b6 to d4d4b57 Compare July 18, 2015 02:26
This will silence deprecation warnings.

Most of the test can be changed from `render :text` to render `:plain`
or `render :body` right away. However, there are some tests that needed
to be fixed by hand as they actually assert the default Content-Type
returned from `render :body`.
@sikachu sikachu force-pushed the silence-render-text-warning branch from d4d4b57 to 8cb8ce9 Compare July 18, 2015 02:27
@sikachu sikachu closed this Jul 18, 2015
@sikachu sikachu reopened this Jul 18, 2015
matthewd added a commit that referenced this pull request Jul 18, 2015
Stop using deprecated `render :text` in test
@matthewd matthewd merged commit e78746f into rails:master Jul 18, 2015
@sikachu sikachu deleted the silence-render-text-warning branch July 18, 2015 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants