aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/activerecord
Commit message (Collapse)AuthorAgeFilesLines
* Only preload misses on multifetch cacheLachlan Sylvester2018-03-061-0/+35
|
* Remove unused methods from `RenderPartialWithRecordIdentificationController`yuuji.yaginuma2017-09-301-10/+0
| | | | These methods no longer used since a3da293.
* Use frozen string literal in actionview/Kir Shatrov2017-07-246-0/+12
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-026-6/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-026-0/+6
|\ | | | | | | Enforce frozen string in Rubocop
| * Enforce frozen string in RubocopKir Shatrov2017-07-016-0/+6
| |
* | Make ActionView frozen string literal friendly.Pat Allan2017-06-201-2/+2
|/ | | | Plus a couple of related ActionPack patches.
* Merge pull request https://github.com/rails/rails/pull/28637 from ↵Kasper Timm Hansen2017-06-081-2/+5
| | | | st0012/fix-partial-cache-logging
* Use a hash to record every partial's cache hit status instead of sharing a ↵Stan Lo2017-06-081-0/+1
| | | | boolean.
* Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-181-1/+1
|
* Should escape meta characters in regexpRyuta Kamizono2017-05-071-1/+1
|
* Always use original url_for when generating direct routesAndrew White2017-03-171-0/+46
| | | | | | | Action View overrides `url_for` in the view context to render paths by default when using `url_for` and this means that direct route helpers don't get the full url when called with the url suffix. To fix this always call the original `url_for`.
* Add assertion to polymorphic_routes_test.rbbogdanvlviv2017-02-201-2/+1
| | | | | | | | | | | | | | | | The assertion will ensure that the behavior doesn't regress. assert_equal "/projects", polymorphic_path("projects") Remove FIXME related to polymorphic_url behavior. polymorphic_url with Symbol or String works equally. Example: default_url_options[:host] = "example.com" polymorphic_url(:projects) # => "http://example.com/projects" polymorphic_url("projects") # => "http://example.com/projects" Related to 37d4415a7b433fcb987b1c6a5b51bf2d8efc5d5e
* module Blog; class Post appears twice in AV testsAkira Matsuda2017-02-021-3/+3
| | | | This causes TypeError when loaded separately
* class Foo < Struct.new(:x) creates an extra unneeded anonymous classAkira Matsuda2017-01-131-1/+1
| | | | because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
* Reduce string objects by using \ instead of + or << for concatenating stringsAkira Matsuda2017-01-121-1/+1
| | | | (I personally prefer writing one string in one line no matter how long it is, though)
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-051-1/+1
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* Privatize unneededly protected methods in Action View testsAkira Matsuda2016-12-231-1/+1
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-1/+1
|
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-1/+1
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* Add three new rubocop rulesRafael Mendonça França2016-08-162-2/+2
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-24/+24
|
* remove redundant curlies from hash argumentsXavier Noria2016-08-061-3/+3
|
* modernizes hash syntax in actionviewXavier Noria2016-08-064-37/+37
|
* applies new string literal convention in actionview/testXavier Noria2016-08-066-44/+44
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Store the old logger before calling superRafael Mendonça França2016-07-171-1/+1
| | | | | | setup in ActiveSupport::LogSubscriber::TestHelper call set_logger that will change ActionController::Base.logger to the MockLogger so that logger will be always MockLogger
* Fix debug helper testRyuta Kamizono2016-06-031-1/+4
|
* Fix calling cache helper with a relationLachlan Sylvester2015-08-281-0/+18
|
* Remove `assigns` and `assert_template`.Guo Xiang Tan2015-05-301-16/+2
|
* :put_litter_in_its_place: Unused methodsAkira Matsuda2015-04-251-4/+0
|
* don't need to rescue Exception in this caseAaron Patterson2015-03-051-0/+6
|
* Avoid accurate assertions on error messagesRobin Dupret2015-03-021-1/+1
| | | | | Since there are disparities between the raised error messages on the different implementations, let's avoid being too accurate.
* Make the helpers a required argumentEvan Phoenix2015-02-191-1/+1
|
* Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846robertomiranda2015-01-311-1/+1
| | | | ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
* Fix form_for to work with objects that implement to_modelTravis Grathwell2014-12-291-5/+15
| | | | | | | | | | | | | Previously, if you tried to use form_for with a presenter object that implements to_model, it would crash in action_dispatch/routing/polymorphic_routes.rb when asking the presenter whether it is .persisted? Now, we always ask .persisted? of the to_model object instead. This seems to been an issue since 1606fc9d840da869a60213bc889da6fcf1fdc431 Signed-off-by: Eugenia Dellapenna <eugenia.dellapenna@gmail.com>
* Move test that depends on ActiveRecordclaudiob2014-11-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | This commit moves a test from `test/template` to `test/activerecord` since the test depends on ActiveRecord. This matches the documentation from [RUNNING_UNIT_TESTS](https://github.com/rails/rails/blob/f28d1ddd507174ac233b773cc4f35c3c05ad32e7/actionview/RUNNING_UNIT_TESTS.rdoc): > Test cases in the test/activerecord/ directory depend on having activerecord and sqlite3 installed. > If Active Record is not in actionview/../activerecord directory, or the sqlite3 rubygem is not installed, these tests are skipped. > Other tests are runnable from a fresh copy of actionview without any configuration. --- More details about this commit. All the tests starting with `require 'active_record_unit'` are already inside `test/activerecord`, except for the one test this commit moves. If you don't have `active_record` on your machine, the following command currently fails on master: ```bash ```
* Remove internal options from query string of pathsGert Goet2014-09-251-0/+9
| | | | Fixes #17057
* Remove warningRafael Mendonça França2014-09-011-2/+2
|
* Allow polymorphic routes with nil when a route can still be drawnSammy Larbi2014-08-311-2/+34
| | | | | | | | | | | | | | | | Suppose you have two resources routed in the following manner: ```ruby resources :blogs do resources :posts end resources :posts ``` When using polymorphic resource routing like `url_for([@blog, @post])`, and `@blog` is `nil` Rails should still try to match the route to the top-level posts resource. Fixes #16754
* Removed warningRafael Mendonça França2014-08-181-1/+1
|
* Merge pull request #15889 from carnesmedia/model-nameRafael Mendonça França2014-08-171-2/+2
|\ | | | | | | Use #model_name on instances instead of classes
| * Use #model_name on instances instead of classesAmiel Martin2014-06-241-2/+2
| | | | | | | | | | | | This allows rails code to be more confdent when asking for a model name, instead of having to ask for the class. Rails core discussion here: https://groups.google.com/forum/#!topic/rubyonrails-core/ThSaXw9y1F8
* | Remove usafe of respond_to in ActionView testsJosé Valim2014-08-171-3/+1
| |
* | Properly assert for the expected messagesCarlos Antonio da Silva2014-07-301-4/+8
|/ | | | | | The message passed to Minitest's assert_raise is used as output in case the assertion fails, but we can test against the exact message by using the actual exception object that is returned from the assert_raise call.
* fix bad mergeAaron Patterson2014-05-121-15/+0
|
* add a test for the parameters sent to the url helper for new recordsAaron Patterson2014-05-121-0/+15
|
* add a test with three objectsAaron Patterson2014-05-121-2/+13
|
* add a test for passing two models to the polymorphic_url methodAaron Patterson2014-05-121-0/+8
|
* add tests for path based url_for callsAaron Patterson2014-05-081-2/+19
|