aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/compiled_templates_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove actionview tests which modify fixturesJohn Hawthorn2019-06-051-39/+1
| | | | | | | | | | We shouldn't modify fixtures (or any files which are checked-in). It prevents us from parallelizing, and probably has other issues. We could fix these tests by copying the file to a tmpdir and modifying it there, but I don't think they are testing anything useful anymore. Re-initializing a resolver isn't representative of "uncached" rendering (either in dev-mode or using lookup_context.disable_cache).
* Prefer render template: in testsJohn Hawthorn2019-03-211-13/+13
| | | | | | | | | | | | 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:`.
* 🚨 Make the cops happy 🚨Aaron Patterson2019-02-061-1/+1
|
* Move templates to an anonymous subclass of AV::BaseAaron Patterson2019-02-061-3/+14
| | | | | Now we can throw away the subclass and the generated methods will get GC'd too
* Tighten up the AV::Base constructorAaron Patterson2019-01-291-2/+2
| | | | | | | | | | | | | | | The AV::Base constructor was too complicated, and this commit tightens up the parameters it will take. At runtime, AV::Base is most commonly constructed here: https://github.com/rails/rails/blob/94d54fa4ab641a0ddeb173409cb41cc5becc02a9/actionview/lib/action_view/rendering.rb#L72-L74 This provides an AV::Renderer instance, a hash of assignments, and a controller instance. Since this is the common case for construction, we should remove logic from the constructor that handles other cases. This commit introduces special constructors for those other cases. Interestingly, most code paths that construct AV::Base "strangely" are tests.
* Use frozen string literal in actionview/Kir Shatrov2017-07-241-0/+2
|
* 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
|
* Allow render locals to be assigned to instance variablesAndrew White2017-01-151-0/+4
| | | | | | | | | 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-091-4/+10
|
* Enable `block` variable in viewToshimaru2016-12-091-0/+4
| | | | Remove `block` keyword from reserved method names
* Change render to support any hash keys in localsPeter Schilling2016-10-021-0/+19
| | | | | | | | | | | | | | | | | | | 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.
* modernizes hash syntax in actionviewXavier Noria2016-08-061-9/+9
|
* applies new string literal convention in actionview/testXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* handle <%== nil %> casesAaron Patterson2014-09-141-0/+4
| | | | | 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
* Move cleanup into teardown, delete obsolete code.Zuhao Wan2014-06-141-8/+1
|
* Remove unneeded filesPiotr Sarnacki2013-06-201-1/+0
|
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+63