Commit Graph

4702 Commits

Author SHA1 Message Date
Akira Matsuda + Koichi Sasada
b7b27fc2a3 Set Thread.abort_on_exception for the whole AS, AP, and AR tests
this would give us some more clues in case a test silently dies inside Thread
2013-01-24 20:00:45 +09:00
Xavier Noria
8ac94d7c89 ActionDispatch::Http::UploadedFile is a permitted scalar [Closes #9051] 2013-01-23 23:15:26 +01:00
Rafael Mendonça França
cb56c39b51 Lets kepp using Ruby 1.9 syntax 2013-01-22 10:40:33 -02:00
Carlos Antonio da Silva
bf112e551b Remove tabs, use spaces ✂️
[ci skip]
2013-01-22 00:35:33 -02:00
Akira Matsuda
1e8d5e62c6 Merge branch 'isolating_tests'
Now we're almost ready to remove this: https://github.com/rails/rails/blob/5294ad8/activesupport/lib/active_support/test_case.rb#L29
2013-01-22 10:27:12 +09:00
Akira Matsuda
9b520d31e5 Restore I18n.locale after running tests 2013-01-22 10:26:44 +09:00
Rafael Mendonça França
5e4fb4da83 Stylistic pass at form_helper_test 2013-01-21 23:01:09 -02:00
José Mota
ee82ce7829 Capture block so content won't leak.
The [following pull request](https://github.com/rails/rails/pull/8916) fixed
the block being passed to the appropriate helper method. However, the content
being passed into the block is generating repeated markup on the page due to
some weird ERb evaluation.

This commit tries to capture the block's generated output so the page isn't
flooded with markup.

[Rafael França + José Mota]

Closes #8936
2013-01-21 22:02:02 -02:00
Akira Matsuda
d1c02a7fc2 Make sure to reset default_url_options 2013-01-22 05:24:23 +09:00
Andrew White
c4106d0c08 Duplicate possible frozen string from route
Ruby 1.9 freezes Hash string keys by default so where a route is
defined like this:

  get 'search' => 'search'

then the Mapper will derive the action from the key. This blows up
later when the action is added to the parameters hash and the
encoding is forced.

Closes #3429
2013-01-21 17:14:10 +00:00
Rafael Mendonça França
c6a39c01f7 Merge pull request #9014 from virusman/form_helpers_ar_tests
AR integration tests for form helpers
2013-01-21 05:52:42 -08:00
virusman
9047ca019a Added AR integration tests for form helpers 2013-01-21 17:09:12 +04:00
Rafael Mendonça França
68a6fb6953 Merge pull request #9001 from schneems/schneems/routes-path-js
In Browser Path Matching with Javascript
2013-01-21 04:06:31 -08:00
Carlos Antonio da Silva
57b65ef416 Fix setting expected value in translation tests
It was being set to nil instead due to the wrong assignment.
2013-01-21 09:29:03 -02:00
schneems
8b72d689e3 In Browser Path Matching with Javascript
When debugging routes ,it can sometimes be difficult to understand exactly how the paths are matched. This PR adds a JS based path matching widget to the `/rails/info/routes` output. You can enter in a path, and it will tell you which of the routes that path matches, while preserving order (top match wins).

The matching widget in action:

![](http://f.cl.ly/items/3A2F0v2m3m1Z1p3P3O3k/path-match.gif)

Prior to this PR the only way to check matching paths is via mental math, or typing in a path in the url bar and seeing where it goes. This feature will be an invaluable debugging tool by dramatically decreasing the time needed to check a path match. 

ATP actionpack
2013-01-20 23:10:24 -06:00
Rafael Mendonça França
e4dbfce1c3 Merge pull request #9007 from dpree/master
Enhanced tests for AbstractController::Translation module
2013-01-20 20:26:17 -08:00
Carlos Antonio da Silva
e0cc7ab3ff Add missing assert calls 2013-01-20 22:03:31 -02:00
Xavier Noria
cbec22ce57 strong parameters filters permitted scalars 2013-01-20 17:59:53 +01:00
Jens Bissinger
4685d75736 Removed ActionController::Base dependency from abstract controller translation tests. 2013-01-20 15:53:43 +01:00
Jens Bissinger
1de60c54d3 Test abstract controller's localize method. 2013-01-20 15:44:03 +01:00
Aaron Patterson
b718998f3e Merge pull request #8978 from chrismcg/remove_i18n_symbol_dependency
Remove i18n symbol dependency
2013-01-19 11:20:50 -08:00
Rafael Mendonça França
57126ee5e3 Restore and adapt the implementation reverted at
cc1c3c5be0

Now instead of raise, we log by default in development and test
2013-01-19 15:32:27 -02:00
Thomas Drake-Brockman
130370b1c8 Added ability to raise or log on unpermitted params. 2013-01-20 00:39:24 +08:00
Chris McGrath
6bb784eab0 Remove i18n symbol dependency
date.order is the only key in rails i18n that is required to be a
symbol. This patch allows for symbols or strings which means:

* No requirement for symbol type in .yml files. A future
  YAML.safe_load wouldn't need to load symbols
* Rails could actually use json rather than yml as the backend
2013-01-17 15:21:26 +00:00
Konstantin Papkovskiy
bebb02fd1c Fix ActionDispatch::Request#formats when HTTP_ACCEPT header is empty string 2013-01-17 17:42:49 +04:00
Carlos Antonio da Silva
ee314a5e5a Remove useless || operation 2013-01-17 09:28:07 -02:00
Arun Agrawal
c9362182c8 Removing : warning: ambiguous first argument; 2013-01-17 14:43:11 +05:30
Carlos Antonio da Silva
038574a538 Deprecate direct calls to AC::RecordIdentifier.dom_id and dom_class
Also add some generic tests to ensure they're properly deprecated.
2013-01-16 23:09:36 -02:00
Colin Burn-Murdoch
3daff0508b Fix date_select :selected option so you can pass it nil 2013-01-16 21:52:09 +00:00
Carlos Antonio da Silva
e5f5863e86 Remove warnings: "(...) interpreted as grouped expression" 2013-01-16 09:41:08 -02:00
Aditya Sanghi
3c19064610 adding regression test in master for #8631 2013-01-16 16:59:45 +05:30
Rafael Mendonça França
e42b5f99eb Merge pull request #8958 from balexand/strong_parameters_exception_handling
Strong parameters exception handling
2013-01-15 17:28:29 -08:00
Brian Alexander
8e221127ab strong parameters exception handling 2013-01-15 17:45:34 -07:00
Edward Anderson
7925884b5e Remove header bloat introduced by BestStandardsSupport middleware
The same headers were being duplicated on every request.
2013-01-15 19:16:08 -05:00
Andrew White
f1d8f2af72 Change the behavior of route defaults
This commit changes route defaults so that explicit defaults are no
longer required where the key is not part of the path. For example:

  resources :posts, bucket_type: 'posts'

will be required whenever constructing the url from a hash such as a
functional test or using url_for directly. However using the explicit
form alters the behavior so it's not required:

  resources :projects, defaults: { bucket_type: 'projects' }

This changes existing behavior slightly in that any routes which
only differ in their defaults will match the first route rather
than the closest match.

Closes #8814
2013-01-15 17:22:25 +00:00
Andrew White
90d2802b71 Add support for other types of routing constraints
This now allows the use of arrays like this:

  get '/foo/:action', to: 'foo', constraints: { subdomain: %w[www admin] }

or constraints where the request method returns an Fixnum like this:

  get '/foo', to: 'foo#index', constraints: { port: 8080 }

Note that this only applies to constraints on the request - path
constraints still need to be specified as Regexps as the various
constraints are compiled into a single Regexp.
2013-01-15 17:21:33 +00:00
Andrew White
b28fc685a9 Ensure port is set when passed via the process method 2013-01-15 17:21:33 +00:00
Andrew White
db06d12826 Raise correct exception now Journey is integrated.
Now that Journey has been integrated into ActionDispatch we can raise
the exception ActionController::UrlGenerationError directly rather than
raising the internal Journey::Router::RoutingError and then have
ActionDispatch::Routing::RouteSet#generate re-raise the exception.
2013-01-15 17:21:33 +00:00
Steve Klabnik
1dd89250d1 Merge pull request #8938 from colinbm/date_select_value
Rename :value to :selected for date_select, and add missing tests/docs
2013-01-14 12:18:36 -08:00
Colin Burn-Murdoch
1fecaf15d7 Rename :value option to :selected, in line with other select helpers
Add tests for time & datetime.
Add documentation.
2013-01-14 19:49:07 +00:00
Jeremy Kemper
bf095770e5 Revert benchmark helper regression. Use a #capture within a #benchmark
block. Breaks benchmark calls that return non-String values otherwise.

Revert "add benchmark helper that works in erb"

This reverts commit 904e544cc8f5846de7c31827bb5556c6a238c0de.

Conflicts:
	actionpack/lib/action_view/helpers.rb
	actionpack/lib/action_view/helpers/benchmark_helper.rb
	actionpack/test/template/benchmark_helper_test.rb
2013-01-14 10:24:43 -07:00
Rafael Mendonça França
242f12506d Merge pull request #8916 from josemota/collection-with-block
Collection radio buttons and collection check boxes through FormBuilder render the provided block.

Closes #8897
2013-01-13 18:27:41 -08:00
Colin Burn-Murdoch
aea3820261 Allow value to be set on date_select 2013-01-13 21:03:21 +00:00
Steve Klabnik
a0265b98f1 Associaton -> Association 2013-01-13 10:43:24 -05:00
José Mota
8cc60d8136 Collection radio buttons and collection check boxes through FormBuilder render
the provided block.

In the case of having a form_for method being called, the block for each
collection would not be passed and thus the result expected was always the same.
This patch passes the block to the original method like it would be assumed.
2013-01-12 17:42:18 +00:00
Jon Leighton
94797ed146 Merge pull request #8623 from virusman/form_helpers_collectionproxy_fix
Fixed nested fields bug when called with AssociationProxy
2013-01-11 03:08:41 -08:00
Dylan Smith
bae92681be Fix json params parsing regression for non-object JSON content.
Fixes #8845.
2013-01-11 00:28:32 -05:00
Rafael Mendonça França
2b5019e234 Merge pull request #8821 from jamis/master
Evaluate view_cache_dependencies at the instance level

Conflicts:
	actionpack/lib/action_controller/caching.rb
2013-01-10 13:34:40 -02:00
Carlos Antonio da Silva
b28d6e2c76 Remove :yaml related tests and fix other related to parsing empty arrays
All Action Pack tests are green.
2013-01-08 20:27:48 -02:00
Jeremy Kemper
46e0d2397e CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml. 2013-01-08 12:42:29 -08:00