1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

18 commits

Author SHA1 Message Date
Aaron Patterson
8a47e87267 handle <%== nil %> cases
This is much less common than string literal appends, so add a special
case method for it.  Maybe fixes bug reported by @jeremy on 97ef636191
2014-09-14 17:11:13 -07: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
Piotr Chmolowski
025c691536 Ensure LookupContext in Digestor selects correct variant
Related to: #14242 #14243 14293

Variants passed to LookupContext#find() seem to be ignored, so
I've used the setter instead: `finder.variants = [ variant ]`.

I've also added some more test cases for variants. Hopefully this
time passing tests will mean it actually works.
2014-03-09 08:47:17 +01:00
Piotr Chmolowski
1858cc6070 Variants in ActionView::Digestor
Take variants into account when calculating template digests in
ActionView::Digest.

Digestor#digest now takes a hash as an argument to support variants and
allow more flexibility in the future. Old-style arguments have been
deprecated.

Fixes #14242
2014-03-04 15:02:58 +01:00
Iain Beeston
5b793a8add Added tests to render helper that expect render partial: @foo to
automatically call @foo.to_partial_path

Calling `render @foo` allows local variables but not options to be
passed to the partial renderer. The correct way to render an object AND
pass options to the partial renderer is to pass the object in the
`:partial` parameter. However, there were previously no tests for this
behaviour (in `render_helper_test.rb` at least).
2014-02-12 17:40:52 +00:00
Akira Matsuda
222f00b422 Unused classes in AV tests 2013-12-24 11:04:49 +09:00
claudiob
d6efc1edc1 Remove unused AV helper fixtures from e10a2531
Several fixtures for helpers are removed. They were introduced in
ActionView by @strzalek but never referenced in any test.
2013-09-14 10:30:17 -07:00
claudiob
61d2391352 Remove helper fixtures not used in any test
The fixture for module AbcHelper defines three functions bare_a,
bare_b and bare_c, but only bare_a is used in the code that tests
helper functions.
2013-09-09 14:19:09 -07:00
Łukasz Strzałkowski
e10a25310f Move abstract's controller tests to AV
The ones that were actually testing AV functionality and should belong in there
2013-08-25 11:40:11 +02: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
Łukasz Strzałkowski
1b446d06dd Move view_paths from AP to AV 2013-08-25 11:39:07 +02:00
Rafael Mendonça França
09f6fe1cd4 Fix "Stack Level Too Deep" error when rendering recursive partials
When rendering recursive partial Action View is trying to generate the
view digest infinitly causing a stack level error.

Fixes #11340
2013-07-07 13:44:16 -03:00
Łukasz Strzałkowski
08998d2eec Restore mistakenly removed malformed file fixtures 2013-06-20 23:35:48 +02:00
Łukasz Strzałkowski
6241513736 Fix digestor tests 2013-06-20 17:23:16 +02:00
Łukasz Strzałkowski
c815775d01 Copy company test fixture to AV (fixes failing test) 2013-06-20 17:23:16 +02:00
Piotr Sarnacki
f12109448b Remove unneeded test fixtures in AV 2013-06-20 17:23:16 +02:00
Piotr Sarnacki
eb23754ebb Move template tests from actionpack to actionview 2013-06-20 17:23:16 +02:00