aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
Commit message (Collapse)AuthorAgeFilesLines
* Drop request class from RouteSet constructor.Aaron Patterson2015-03-041-1/+5
| | | | | If you would like to use a custom request class, please subclass and implemet the `request_class` method.
* Merge pull request #19147 from gsamokovarov/work-around-ruby-10695Eileen M. Uchitelle2015-03-021-1/+1
|\ | | | | Work around for upstream Ruby bug #10685
| * Work around for upstream Ruby bug #10685Genadi Samokovarov2015-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In f6e293ec54f02f83cdb37502bea117f66f87bcae we avoided a segfault in the tests, however I think we should try to avoid the crash, as it may happen in user code as well. Here is what I distiled the bug down to: ```ruby # Rails case - works on 2.0, 2.1; crashes on 2.2 require 'action_dispatch' ActionDispatch::Response.new(200, "Content-Type" => "text/xml") # General case - works on 2.0, 2.1; crashes on 2.2 def foo(optional = {}, default_argument: nil) end foo('quux' => 'bar') ```
* | Avoid accurate assertions on error messagesRobin Dupret2015-03-021-2/+2
|/ | | | | Since there are disparities between the raised error messages on the different implementations, let's avoid being too accurate.
* Fix segmentation fault in ActionPack testseileencodes2015-02-281-1/+1
| | | | | | Introduced in f6e293e ActionPack tests began sefaulting. I found that it was the kwargs and the test causing the seg fault was missing the new default_headers argument.
* Revert integration test refactoring that caused app test regressionsJeremy Kemper2015-02-261-0/+4
| | | | | | | | | | | | Haven't diagnosed yet. No similarly failing tests in Rails to work from. cc @tenderlove, @eileencodes Revert "there is always an integration session, so remove the check" Revert "lazily create the integration session" Revert "use before_setup to set up test instance variables" This reverts commits 4cf3b8ac47f109fa83a6f66eb97d6cb0eace0d05, 303567e554de26822f3107be55c471d6477a745f, and fa63448420d3385dbd043aca22dba973b45b8bb2.
* Revert "Merge pull request #18764 from tsun1215/master"Jeremy Kemper2015-02-261-4/+5
| | | | | This reverts commit b6dd0c4ddebf5e7aab0a669915cb349ec65e5b88, reversing changes made to de9a3748c436f849dd1877851115cd94663c2725.
* Merge pull request #18434 from brainopia/change_filter_on_rails_info_routesRichard Schneeman2015-02-261-8/+0
|\ | | | | Change filter on /rails/info/routes to use an actual path regexp from rails
| * Change filter on /rails/info/routes to use an actual path regexp from railsbrainopia2015-02-231-8/+0
| | | | | | | | | | | | | | | | Change filter on /rails/info/routes to use an actual path regexp from rails and not approximate javascript version. Oniguruma supports much more extensive list of features than javascript regexp engine. Fixes #18402.
* | Add a failing test demonstrating regression with HEAD requests to Rack apps, ↵Jeremy Kemper2015-02-241-3/+9
|/ | | | re #18764
* Prefer request_id over uuid and test the aliasRafael Mendonça França2015-02-201-4/+8
|
* Merge pull request #18218 from brainopia/fix_match_shorthand_in_routesRafael Mendonça França2015-02-201-0/+9
|\ | | | | Don't use shorthand match on routes with inappropriate symbols
| * Improve shorthand matching for routesbrainopia2015-01-251-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shorthand route match is when controller and action are taken literally from path. E.g. get '/foo/bar' # => will use 'foo#bar' as endpoint get '/foo/bar/baz' # => will use 'foo/bar#baz' as endpoint Not any path with level two or more of nesting can be used as shortcut. If path contains any characters outside of /[\w-]/ then it can't be used as such. This commit ensures that invalid shortcuts aren't used. ':controller/:action/postfix' - is an example of invalid shortcut that was previosly matched and led to exception: "ArgumentError - ':controller/:action' is not a supported controller name"
* | lazily create the integration sessionAaron Patterson2015-02-121-4/+0
| | | | | | | | now we don't have to call reset! everywhere
* | Explicitly ignored wildcard verbs from head_routesTerence Sun2015-02-081-0/+12
| | | | | | | | | | | | In match_head_routes, deleted the routes in which request.request_method was empty (matches all HTTP verbs) when responding to a HEAD request. This prevents catch-all routes (such as Racks) from intercepting the HEAD request. Fixes #18698
* | Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-032-2/+0
| | | | | | | | onwards.
* | Show proper traces on Windows for the error pagesGenadi Samokovarov2015-02-011-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an issue brought up by @daniel-rikowski in rails/web-console#91. Citing his PR proposal here: > Prior to this, backtrace lines were simply split by a single colon. > > Unfortunately that is also the drive letter delimiter in Windows paths > which resulted in a lot of empty source fragments of "C:0". ("C" from > the drive letter and 0 from "/path/to/rails/file.rb:16".to_i) > > Now the trace line is split by the first colon followed by some digits, > which works for both Windows and Unix path styles. Now, the PR was sent against web-console, because of the templates copy issue we used to had. Instead of bothering the contributor to reopen the issue against upstream Rails itself, I will make sure he gets the credit by putting his name in [rails-contributors/hard_coded_authors.rb][]. [rails-contributors/hard_coded_authors.rb]: (https://github.com/fxn/rails-contributors/blob/master/app/models/names_manager/hard_coded_authors.rb).
* | Consistent usage of spaces in hashes across our codebaseRafael Mendonça França2015-01-2911-53/+53
| |
* | Switch to kwargs in ActionController::TestCase and ActionDispatch::IntegrationKir Shatrov2015-01-2913-80/+81
|/ | | | | | | | Non-kwargs requests are deprecated now. Guides are updated as well. `post url, nil, nil, { a: 'b' }` doesn't make sense. `post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
* Fix name_for_action in routingrono232015-01-191-0/+38
|
* No need of requiring `rbconfig`, it is by-default loadedKuldeep Aggarwal2015-01-101-1/+0
|
* Remove deprecated usage of string keys in URL helpersRafael Mendonça França2015-01-041-20/+0
|
* Remove deprecated `only_path` option on `*_path` helpersRafael Mendonça França2015-01-041-44/+0
|
* Remove deprecated support to define routes with `:to` option thatRafael Mendonça França2015-01-041-30/+4
| | | | doesn't contain `#`
* Remove deprecated `ActionDispatch::Response#to_ary`Rafael Mendonça França2015-01-041-16/+2
|
* Merge pull request #10380 from JonRowe/test_all_domain_2_letter_tldRafael Mendonça França2015-01-021-0/+7
|\ | | | | | | Assert that 2 letter tlds with 3 letter domain names work when option specified.
| * add test asserting that 2 letter tlds with 3 letter domain names work when ↵Jon Rowe2013-04-301-0/+7
| | | | | | | | option specified
* | Use released rackGodfrey Chan2014-12-191-1/+1
| | | | | | | | `rack.version` was bumped in https://github.com/rack/rack/commit/28e77c710ac2ddb35c436d78d72e28f28f964446
* | allow reseting of request variantsTimo Schilling2014-12-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of `variants=` don't allow a resetting to nil, wich is the default value. This results in the following code smell: ```ruby case request.user_agent when /iPhone/ request.variants = :phone when /iPad/ request.variants = :ipad end ``` With the ability to reset variants to nil, it could be: ```ruby request.variants = case request.user_agent when /iPhone/ :phone when /iPad/ :ipad end ```
* | Don't convert empty arrays to nils when deep munging paramsChris Sinjakli2014-12-152-4/+4
| |
* | Merge pull request #18022 from agrobbin/url-helpers-optional-scopesSantiago Pastorino2014-12-131-0/+12
|\ \ | | | | | | Allow URL helpers to work with optional scopes
| * | allow URL helpers to work with optional scopesAlex Robbin2014-12-131-0/+12
| | |
* | | ParameterFilter shouldn't try to dup symbol keysNate Berkopec2014-12-131-2/+2
|/ /
* | Fix handling of positional url helper arguments when format is falseTatiana Soukiassian2014-12-131-0/+28
| | | | | | | | | | | | | | There is no need to subtract one from the path_params size when there is no format parameter because it is not present in the path_params array. Fixes #17819.
* | Mounted Rack apps should have default named routes based on app nameT.J. Schuck2014-12-061-11/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression in 4.2.0 from 4.1.8. https://github.com/rails/rails/pull/17823 fixed a similar regression regarding _explicitly_ named routes for a mounted Rack app, but there was another regression for the default value. With a route like: Rails.application.routes.draw do mount Mountable::Web, at: 'some_route' end The "Prefix" column of rake routes gives the following: - 4.1.8: mountable_web - 4.2.0.beta1-4: [nothing] - 4.2.0.rc1: [nothing] - 4.2.0.rc2: some_route <- regression This fixes the default to go back to being based off the name of the class like the docs specify: https://github.com/rails/rails/blob/785d04e3109f69d0b9b9f4732179592f0ef04e52/actionpack/lib/action_dispatch/routing/mapper.rb#L558-L560 Explicitly named routes still work correctly per https://github.com/rails/rails/pull/17823: Rails.application.routes.draw do mount Mountable::Web, at: 'some_route', as: 'named' end - 4.1.8: named - 4.2.0.beta1-4: [nothing] - 4.2.0.rc1: [nothing] - 4.2.0.rc2: named
* | Merge pull request #17792 from rockrep/masterRafael Mendonça França2014-12-041-0/+10
|\ \ | | | | | | | | | allow 'all' for :domain option in addition to :all
| * | allow 'all' for :domain option in addition to :allrockrep2014-11-261-0/+10
| | |
* | | Remove "rescue" clause around "require 'openssl'"claudiob2014-12-031-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some `require 'openssl'` statements were surrounded by `rescue` blocks to deal with Ruby versions that did not support `OpenSSL::Digest::SHA1` or `OpenSSL::PKCS5`. [As @jeremy explains](https://github.com/rails/rails/commit/a6a0904fcb12b876469c48b1c885aadafe9188cf#commitcomment-8826666) in the original commit: > If jruby didn't have jruby-openssl gem, the require wouldn't work. Not sure whether either of these are still relevant today. According to the [release notes for JRuby 1.7.13](http://www.jruby.org/2014/06/24/jruby-1-7-13.html): > jruby-openssl 0.9.5 bundled which means the above `rescue` block is not needed anymore. All the Ruby versions supported by the current version of Rails provide those OpenSSL libraries, so Travis CI should also be happy by removing the `rescue` blocks. --- Just to confirm, with JRuby: $ ruby --version #=> jruby 1.7.16.1 (1.9.3p392) 2014-10-28 4e93f31 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_20-b26 +jit [darwin-x86_64] $ irb irb(main):001:0> require 'openssl' #=> true irb(main):002:0> OpenSSL::Digest::SHA1 #=> OpenSSL::Digest::SHA1 irb(main):003:0> OpenSSL::PKCS5 # => OpenSSL::PKCS5 And with Ruby 2.1: $ ruby --version #=> ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0] $ irb irb(main):001:0> require 'openssl' #=> true irb(main):002:0> OpenSSL::Digest::SHA1 #=> OpenSSL::Digest::SHA1 irb(main):003:0> OpenSSL::PKCS5 #=> OpenSSL::PKCS5
* | | Fix "nonexistent" typo in testsMelissa Xie2014-12-021-2/+2
| | |
* | | Refactor debug viewKir Shatrov2014-12-021-0/+23
| | | | | | | | | Avoid logic in ERB and use helpers
* | | Merge pull request #17823 from byroot/fix-mount-rack-apps-with-asSean Griffin2014-11-291-1/+1
|\ \ \ | | | | | | | | Pure rack apps can be mounted with a name
| * | | Pure rack apps can be mounted with a nameJean Boussier2014-11-291-1/+1
| | | | | | | | | | | | | | | | See https://github.com/rails/rails/commit/9b15828b5c347395b42066a588c88e5eb4e72279#commitcomment-8764492
* | | | Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-2/+2
|/ / /
* | | Merge branch 'deprecate-string-options-in-url-helpers'Sean Griffin2014-11-241-0/+20
|\ \ \
| * | | Deprecate string options in URL helpersMelanie Gilman2014-11-241-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Fixes https://github.com/rails/rails/issues/16958 [Byron Bischoff & Melanie Gilman]
* | | | Show source view and backtrace on missing template errorsGenadi Samokovarov2014-11-241-0/+27
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | This will help you debug missing template errors, especially if they come from a programmatic template selection. Thanks to @dhh for suggesting that. As a bonus, also show request and response info on the routing error page for consistency.
* | | Merge pull request #17642 from tgxworld/fix_template_assertion_on_assignsRafael Mendonça França2014-11-171-1/+13
|\ \ \ | | | | | | | | Fix for assigns(:..) resetting template assertions
| * | | Fix for assigns(:..) resetting template assertionsCalvin Correli2014-11-171-1/+13
| | | | | | | | | | | | | | | | When calling assigns(:...) or cookies(:...), template assertions would be reset, which they obviously shouldn't be.
* | | | Rename #source_extract to #source_extracts in ExceptionWrapperGenadi Samokovarov2014-11-161-2/+2
| | | | | | | | | | | | | | | | | | | | It returns multiple source extracts since 1ed264bc. Also cleaned its result structure, as we no longer need the file in a code extract.
* | | | Don't let #{application,framework,full}_trace be nilGenadi Samokovarov2014-11-161-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | Those three can be nil when exception backtrace is nil. This happens and that forced a couple of nil guards in the code. I'm proposing to make those always return an array, even on nil backtrace.