aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/fixtures
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Enable `Performance/UnfreezeString` copyuuji.yaginuma2018-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`. ```ruby # frozen_string_literal: true require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "benchmark-ips" end Benchmark.ips do |x| x.report('+@') { +"" } x.report('dup') { "".dup } x.compare! end ``` ``` $ ruby -v benchmark.rb ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] Warming up -------------------------------------- +@ 282.289k i/100ms dup 187.638k i/100ms Calculating ------------------------------------- +@ 6.775M (± 3.6%) i/s - 33.875M in 5.006253s dup 3.320M (± 2.2%) i/s - 16.700M in 5.032125s Comparison: +@: 6775299.3 i/s dup: 3320400.7 i/s - 2.04x slower ```
* Fix digesting templates with mixed formatsJavan Makhmali2018-03-201-0/+1
|
* Clean up and consolidate .gitignoresbogdanvlviv2018-02-171-1/+0
| | | | | | | | | | | | | | | | * Global ignores at toplevel .gitignore * Component-specific ignores in each toplevel directory * Remove `actionview/test/tmp/.keep` for JRuby ``` rm actionview/test/tmp/ -fr cd actionview/ bundle exec jruby -Itest test/template/digestor_test.rb ``` Related to #11743, #30392. Closes #29978.
* fix(streaming_template_renderer): I18n.locale broken in layout. I18n gem ↵mfo2017-11-252-0/+3
| | | | 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).
* Use frozen string literal in actionview/Kir Shatrov2017-07-249-0/+18
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-0221-21/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-0221-0/+21
|\ | | | | | | Enforce frozen string in Rubocop
| * Enforce frozen string in RubocopKir Shatrov2017-07-0121-0/+21
| |
* | Make ActionView frozen string literal friendly.Pat Allan2017-06-201-1/+1
|/ | | | Plus a couple of related ActionPack patches.
* 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-012-0/+2
|\ | | | | Add tests for rendering with variants
| * Add tests for render template/partial with variants option.Stan Lo2017-04-142-0/+2
| |
* | Fix all style guides violationsRafael Mendonça França2017-04-199-12/+12
|/ | | | | 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.
* normalizes indentation and whitespace across the projectXavier Noria2016-08-062-2/+1
|
* modernizes hash syntax in actionviewXavier Noria2016-08-062-2/+2
|
* applies new string literal convention in actionview/testXavier Noria2016-08-062-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* New syntax for tag helpers i.e. tag.br instead of tag(br) #25195Marek2016-06-271-0/+3
|
* Fix finding templates for digesting for */* requests that render a ↵Javan Makhmali2016-06-152-0/+2
| | | | non-default (html) template
* Explicity find with the rendered format to handle searching multiple view ↵Javan Makhmali2016-06-151-0/+0
| | | | paths correctly
* Fix digesting templates with identical logical names when requesting a ↵Javan Makhmali2016-06-151-0/+1
| | | | format other than the first default
* 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.
* adds tests for Digestor#nested_dependenciesRyan T. Hosford2016-02-131-0/+2
|
* Add Html template handler that wraps Raw output in an OutputBufferSantiago Pastorino2016-01-052-0/+3
| | | | | | | 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).
* Tweaked wording used in some tests.Sebastian McKenzie2015-10-251-1/+1
|
* Fix calling cache helper with a relationLachlan Sylvester2015-08-281-0/+4
|
* Add wildcard template dependencies.Kasper Timm Hansen2015-07-262-0/+1
|
* Stop using deprecated `render :text` in testPrem Sichanugrist2015-07-171-0/+1
| | | | | | | | | 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`.
* Remove `assigns` and `assert_template`.Guo Xiang Tan2015-05-302-1/+2
|
* 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.
* Deleting unused fixturesThiago Pradi2015-03-142-10/+0
|
* fix ActionView::Template::Error when using Streaming with capture.yuuji.yaginuma2015-03-011-0/+6
| | | | can't acquire a encoding from StreamingBuffer. fixes #12001
* 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
|
* Merge pull request #17878 from claudiob/remove-unused-modgreet-fixtureYves Senn2014-12-021-1/+0
|\ | | | | Remove unused AV/test/fixtures/scope
| * Remove unused AV/test/fixtures/scopeclaudiob2014-12-011-1/+0
| | | | | | | | | | The file `modgreet.erb` was added 8 years ago in 21187c0 and is not used anymore by any test.
* | Remove unused AV/test/fixtures/happy_pathclaudiob2014-12-011-1/+0
|/ | | | | | | | | | The `test/fixtures/happy_path/render_action/hello_world.erb` file was introduced in 8ab37c7 for the `TestRenderAction` test. That test was subsequently removed in 34f058e, so the fixture is not used anymore. If Travis CI is happy, then you can be sure the fixture can be removed.
* Merge pull request #17871 from claudiob/remove-unused-blog-public-fixturesSantiago Pastorino2014-12-024-4/+0
|\ | | | | Remove unused AV/test/fixtures/blog_public
| * Remove unused AV/test/fixtures/blog_publicclaudiob2014-12-014-4/+0
| | | | | | | | | | | | | | | | The fixtures were added to support StaticTests in 401cd97 but those tests were then removed in d5ad92ce. If Travis CI is happy with this PR, then you can be sure that those fixtures are not needed anymore.
* | Remove one AV fixture (duplicate of an AP fixture)claudiob2014-12-011-3/+0
|/ | | | | | | | | | | | Both ActionPack and ActionView include `test/fixtures/functional_caching/fragment_cached_without_digest.html.erb`. The [ActionPack file](https://github.com/rails/rails/blob/master/actionpack/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb) is used by the tests. The [ActionView file](https://github.com/rails/rails/blob/master/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb) is not: it was introduced in eb23754e when some tests and fixtures were moved from AP to AV, but no tests in AV uses the fixture. Long story short: if Travis CI is happy with removing the fixture, you can be sure that is not needed anymore!