aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/fixtures/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix partial caching ignore repeated items issuest00122019-04-041-0/+1
| | | | | | This is because we only use hash to maintain the result. So when the key are the same, the result would be skipped. The solution is to maintain an array for tracking every item's position to restructure the result.
* Merge pull request #35308 from ↵Rafael França2019-03-281-0/+4
|\ | | | | | | | | erose/better-error-reporting-for-syntax-errors-in-templates Display a more helpful error message when an ERB template has a Ruby syntax error.
| * Add handling and tests.Eli Rose2019-02-171-0/+4
| |
* | Prefer render template: in testsJohn Hawthorn2019-03-212-2/+2
|/ | | | | | | | | | | | 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:`.
* Address to useless assignment `formats = nil` after #35254Ryuta Kamizono2019-02-141-2/+0
| | | | https://codeclimate.com/github/rails/rails/pull/35254
* Adding another failing test caseAaron Patterson2019-02-1110-5/+29
|
* Add a failing test for #35222Aaron Patterson2019-02-114-0/+8
|
* fix(streaming_template_renderer): I18n.locale broken in layout. I18n gem ↵mfo2017-11-251-0/+1
| | | | stores the current locale in Thread.current[:local] (see: https://github.com/svenfuchs/i18n/blob/master/lib/i18n.rb#L23). StreamingTemplateRenderer is implemented with Fiber which have its own stack of locals and can not access Thread.current.locals(keys, see: https://ruby-doc.org/core-2.2.0/Thread.html#class-Thread-label-Fiber-local+vs.+Thread-local).
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Use a hash to record every partial's cache hit status instead of sharing a ↵Stan Lo2017-06-082-0/+4
| | | | boolean.
* Merge pull request #28753 from st0012/add-render-with-variants-testKasper Timm Hansen2017-05-011-0/+1
|\ | | | | Add tests for rendering with variants
| * Add tests for render template/partial with variants option.Stan Lo2017-04-141-0/+1
| |
* | Fix all style guides violationsRafael Mendonça França2017-04-191-2/+2
|/ | | | | Closes #28382 Closes #28651
* Add partial iteration variable to template keysMatthew Eagar2017-01-252-0/+2
| | | | | | | When rendering heterogeneous collection using `render @collection` or `render partial: @collection`, the expected `<partial_name>_iteration` variable is missing due to `find_template` not having the name of the iteration variable included in its cache keys.
* Allow render locals to be assigned to instance variablesAndrew White2017-01-151-0/+1
| | | | | | | | | In #26672 we blocked use of Ruby keywords as identifiers for view locals but inadvertently broke the use of instance variable names as identifiers. Whilst not explicitly documented this behavior has been around for a long time and there's no need to break it now. Fixes #27480.
* split DELEGATION_RESERVED_METHOD_NAMES in halfToshimaru2016-12-092-1/+1
|
* Enable `block` variable in viewToshimaru2016-12-091-0/+1
| | | | Remove `block` keyword from reserved method names
* Change render to support any hash keys in localsPeter Schilling2016-10-023-0/+3
| | | | | | | | | | | | | | | | | | | this lets you pass ruby keywords to templates: <%= render 'example', class: "cool" %> <%= render 'example', "spaces are" => "a-ok" %> <%= render 'example', Foo: "bar" %> Previously you'd see confusing syntax errors like this: SyntaxError (.../_example.html.erb:1: syntax error, unexpected '=' Now you can reference invalid identifiers through local_assigns. If you try to use an invalid keyword (e.g. class) in your template, you get a syntax error on the line where you use it.
* New syntax for tag helpers i.e. tag.br instead of tag(br) #25195Marek2016-06-271-0/+3
|
* Add render allows unicode text name in partials - 🍣Vipul A M2016-04-171-0/+1
|
* Fix partial rendering with dot in filenameBenjamin Quorning2016-03-041-0/+1
| | | | | | | | When rendering a collection with a partial whose filename contains a dot, e.g. "customer.mobile", we would set a `locals[:'customer.mobile']` variable instead of, as in earlier versions of Rails, `locals[:customer]`. This bug was introduced in da9038eaa5d19c77c734a044c6b35d7bfac01104.
* Add Html template handler that wraps Raw output in an OutputBufferSantiago Pastorino2016-01-051-0/+1
| | | | | | | This fixes the case when you try to render an html you know safe and the file is named something.html. With this commit the content of the html won't be escaped anymore because AV won't use Raw handler and choose Html handler instead.
* Respect value of `:object` if `:object` is false when renderingyui-knk2015-11-131-0/+1
| | | | | This commit fixes the bug convering `false` to `locals[as]` when `options[:object]` is `false` (close #22260).
* Do not put partial name to local_assigns when rendering without an objectHenrik Nygren2015-05-141-0/+1
| | | | | | | | When one rendered a partial template without specifying an object or a collection (e.g. <%= render partial: 'partial_name' %>), Rails would make an object called :partial_name available in local_assigns. I don't think this was the intended behavior, since no local variable called 'partial_name' gets defined in the view.
* Collections automatically cache and fetch partials.Kasper Timm Hansen2015-02-212-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Collections can take advantage of `multi_read` if they render one template and their partials begin with a cache call. The cache call must correspond to either what the collections elements are rendered as, or match the inferred name of the partial. So with a notifications/_notification.html.erb template like: ```ruby <% cache notification %> <%# ... %> <% end %> ``` A collection would be able to use `multi_read` if rendered like: ```ruby <%= render @notifications %> <%= render partial: 'notifications/notification', collection: @notifications, as: :notification %> ```
* Partial template name does no more have to be a valid Ruby identifierAkira Matsuda2015-02-062-0/+1
| | | | because the partial renderer would not create an lvar per each template since c67005f221f102fe2caca231027d9b11cf630484
* Make possible to use blocks with short version of render partialNikolay Shebanov2014-12-191-0/+3
|
* Some valid block calls in templates caused syntax errorsAkira Matsuda2014-11-201-1/+1
| | | | Now ActionView accepts <%= foo(){ %> and <%= foo()do %> :golf:
* handle <%== nil %> casesAaron Patterson2014-09-141-0/+1
| | | | | This is much less common than string literal appends, so add a special case method for it. Maybe fixes bug reported by @jeremy on 97ef636191933f1d4abc92fc10871e6d1195285c
* Ensure LookupContext in Digestor selects correct variantPiotr Chmolowski2014-03-092-0/+2
| | | | | | | | | | 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.
* Restore mistakenly removed malformed file fixturesŁukasz Strzałkowski2013-06-205-0/+5
|
* Remove unneeded test fixtures in AVPiotr Sarnacki2013-06-2040-70/+0
|
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-20111-0/+207