aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/activerecord/polymorphic_routes_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix more offencesRafael Mendonça França2018-09-251-1/+1
|
* make bot happyAaron Patterson2018-09-241-1/+1
|
* Remove deprecated catch-all route in the AV testsAaron Patterson2018-09-241-1/+7
| | | | | | | | This commit removes a deprecated catch-all route in the AV tests. It defines and includes the necessary routes for each test such that we don't need the catch-all anymore. This also helps push us toward #33970
* 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
|
* 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
* `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
* 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.
* remove redundant curlies from hash argumentsXavier Noria2016-08-061-3/+3
|
* modernizes hash syntax in actionviewXavier Noria2016-08-061-18/+18
|
* applies new string literal convention in actionview/testXavier Noria2016-08-061-23/+23
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* 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
|
* 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>
* 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
* 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
* | 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
|
* don't manipulate the testclass, just add helpers to the instanceAaron Patterson2014-05-081-10/+11
|
* add a test for classes with optionsAaron Patterson2014-05-081-0/+7
|
* add tests for the polymorphic_path methodAaron Patterson2014-05-081-0/+3
|
* add more tests around the polymorphic url apiAaron Patterson2014-05-081-0/+12
|
* test for inconsistency between String and Symbol url_for handlingAaron Patterson2014-05-071-0/+4
|
* add tests for symbols passed to polymorphic_urlAaron Patterson2014-05-071-0/+12
|
* apparently passing a string to polymorphic_url is something we supportAaron Patterson2014-05-061-0/+12
| | | | o_O
* make sure url_for works similar to polymorphic_urlAaron Patterson2014-05-061-38/+43
|
* add a test for the parameters sent to the url helper for new recordsAaron Patterson2014-05-061-0/+15
|
* passing a nil in the polymorphic array is not supported. remove nils before ↵Aaron Patterson2014-05-021-4/+4
| | | | you call the method
* passing a nil should always raise an ArgumentErrorAaron Patterson2014-05-021-0/+25
|
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+546