Commit Graph

11 Commits

Author SHA1 Message Date
Rafael Mendonça França d52d773946
Remove deprecated support to passing relative paths to `render file:` 2020-10-30 00:25:14 +00:00
Joel Hawksley 36b01da797 Do not add newlines when annotating rendered views
When rendering a view with annotate_rendered_view_with_filenames
enabled, we were inserting newlines after the BEGIN and END
comments. These newlines are not ideal in some use cases, such
as rendering templates to strings that are then passed around
our application.

As the newlines were added for aesthetic purposes, we think it
makes sense to remove them so that rendered template strings do
not contain extraneous newlines.

As a result of removing these newlines, the annotations
no longer affect the reporting of template error on the correct
line, as addressed in #38950. As such, we've reverted those
changes as well.

Co-authored-by: Chris Gavin <chrisgavin@github.com>
2020-10-06 11:29:36 -06:00
John Hawthorn f35631d466 Prefer render template: in tests
Many tests were using `render file:`, but were only testing the
behaviour of `render template:` (file: just allows more paths/ is less
secure then template:).

The reason for so many `render file:` is probably that they were the old
default.

This commit replaces `render file:` with `render template:` anywhere the
test wasn't specifically interested in using `render file:`.
2019-03-21 13:44:56 -07:00
Matthew Draper 87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
2017-07-02 02:15:17 +09:30
Kir Shatrov cfade1ec7e Enforce frozen string in Rubocop 2017-07-01 02:11:03 +03:00
Rafael Mendonça França 0871e5e5c1
Fix all style guides violations
Closes #28382
Closes #28651
2017-04-19 20:13:42 -04:00
Prem Sichanugrist 8cb8ce98d9 Stop using deprecated `render :text` in test
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`.
2015-07-17 22:27:33 -04:00
Guo Xiang Tan ca83436d1b Remove `assigns` and `assert_template`. 2015-05-30 14:13:57 +08:00
Joel Junström 1f5b360466 Added PartialIteration class used when rendering collections
The iteration object is available as the local variable
"template_name_iteration" when rendering partials with collections.

It gives access to the +size+ of the collection beeing iterated over,
the current +index+ and two convinicence methods +first?+ and +last?+

"template_name_counter" variable is kept but is deprecated.

[Joel Junström + Lucas Uyezu]
2014-07-16 14:50:51 -03:00
Łukasz Strzałkowski c9ef9c1442 Move remaining layouts tests to AV 2013-08-25 11:39:14 +02:00
Łukasz Strzałkowski acc8e25902 Move render_test to AV 2013-08-25 11:39:13 +02:00