Commit Graph

4755 Commits

Author SHA1 Message Date
Yves Senn
afddc0409e format: true does not override existing format constraints.
Closes #9466.

Passing `format: true` used to override the constraints: { format: /json/ }
with `/.+/`. This patch only sets the format if there is no constraint present.
2013-02-27 19:57:41 +01:00
Carlos Antonio da Silva
02037c3ea0 Merge pull request #9218 from Fivell/master
Fix calculation of db_runtime property in
ActiveRecord::Railties::ControllerRuntime#cleanup_view_runtime.

Previously, after raising ActionView::MissingTemplate, db_runtime was
not populated.

Closes #9218, Fixes #9215.

Conflicts:
	activerecord/CHANGELOG.md
2013-02-27 11:47:24 -03:00
Igor
dd0bbd2ccb fix db_runtime attribute value after raising ActionView::MissingTemplate exception 2013-02-27 16:35:22 +02:00
Yves Senn
a689482490 cleanup AP number_helpers_test
* use 1.9 style hash syntax
* don't use brances on assert_equal
* prefere " over '
2013-02-27 13:40:26 +01:00
Yves Senn
152f2f3d3c remove duplicated number_helper tests in AP. They are already in AS.
With 155cd5e6 the number_helpers were moved into AS all the tests were copied over
but the tests in AP were not deleted. This is confusing.

I removed all duplicated tests and reorganized the tests in AP to only test the
functionality, that is added in AP.
2013-02-27 13:32:29 +01:00
Yves Senn
794cbf3e38 allow non-String default params in the router.
Closes #9435.

Skip valid encoding checks for non-String parameters that come
from the matched route's defaults.
2013-02-26 21:53:48 +01:00
Yves Senn
09d9f04d08 the router allows String contraints.
Closes #9432.
2013-02-26 21:09:49 +01:00
Rafael Mendonça França
28bebb225f Merge pull request #9434 from zires/dev
Journey::Path::Pattern#new raise more meaningful exception message.
2013-02-26 09:15:43 -08:00
zires
35f38b71df Make ActionDispatch::Journey::Path::Pattern#new raise more meaningful exception message. 2013-02-27 08:26:51 +08:00
Francesco Rodriguez
7487e79d4d Add tests for #9441 2013-02-26 11:50:48 -05:00
David Heinemeier Hansson
2b7b5f535c Merge pull request #8530 from dasch/dependency-trackers
Custom dependency trackers for the template digestor
2013-02-25 05:11:56 -08:00
grosser
149e3cd376 fix respond_to without blocks not working if one of the blocks is all 2013-02-24 11:47:20 -05:00
Carlos Antonio da Silva
38f347a825 Move number_to_human test from AP to AS
Since all changes from #9347 are related to AS, it seems proper that the
test is placed there as well.
2013-02-22 19:44:50 -03:00
hoffm
4e3ceedeba Address edge case for number_to_human with units option.
ActiveSupport::NumberHelper#number_to_human now returns the number unaltered when
the units hash does not contain the needed key, e.g. when the number provided is less
than the largest key provided.
2013-02-22 08:25:51 -05:00
Andrew White
31f807c7aa Merge pull request #9334 from NARKOZ/time_tag
use ISO 8601 format in time_tag helper
2013-02-21 23:33:36 -08:00
Nihad Abbasov
e8e92c7264 fix time_tag helper and update tests to not rely on dynamically generated values
Before `time_tag Date.today` will return `<time
  datetime="2013-02-14T00:00:00+00:00">February 14, 2013</time>`.
  This commit fixes time_tag helper to use RFC-3339 full-date format
  (Y-m-d) in datetime attribute.
2013-02-22 11:04:13 +04:00
Andrew White
f4b506f60a Merge pull request #9361 from senny/improved_match_shorthand_syntax
determine the match shorthand target early.
2013-02-21 11:36:15 -08:00
Santiago Pastorino
3893979524 Revert "Revert "Merge pull request #4803 from lucascaton/master""
This reverts commit 6871bd9818a9a7d9d8c7e21e253d64c0410fde1d.
2013-02-21 15:34:02 -02:00
Yves Senn
c88ee76928 determine the match shorthand target early.
Closes #7554.

This patch determines the `controller#action` directly
in the `match` method when the shorthand syntax is used.
this prevents problems with namespaces and scopes.
2013-02-21 17:44:31 +01:00
Carlos Antonio da Silva
b4051edf84 Use #grep to filter priority zones when a regexp is given 2013-02-21 13:32:34 -03:00
Carlos Antonio da Silva
1323374333 Fix test name and refactor fake timezones creation in form options test 2013-02-21 13:32:34 -03:00
Steve Klabnik
ea544e9b48 Merge pull request #9354 from NARKOZ/remove-warnings
remove assigned but unused variables
2013-02-21 06:58:16 -08:00
Nihad Abbasov
5e5290586f remove assigned but unused variable warning 2013-02-21 18:12:24 +04:00
Fabio Kreusch
fa9ec0a678 Rack::Test::UploadedFile is a permitted scalar 2013-02-21 11:00:26 -03:00
Santiago Pastorino
6871bd9818 Revert "Merge pull request #4803 from lucascaton/master"
This reverts commit bb842e8d2111e50b21a14b8bd6d89371a4b9cd68, reversing
changes made to 40c287c7983c20c498f6a8a2ea49e9a6455347f7.
This was causing issues in one of our apps we just upgraded.
ActionController::RoutingError: No route matches [GET]
"/images/favicon.ico"
favicon_link_tag now returns '/images/favicon.ico' and in 3.2 returned
'/favicon.ico'
Browsers by default look for favicon.ico in the root directory

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_view/helpers/asset_tag_helper.rb
2013-02-20 15:51:51 -02:00
Daniel Schierbeck
ec23296eb6 Register trackers on extensions, not handlers 2013-02-20 16:42:30 +01:00
Daniel Schierbeck
4452849064 Return an empty array if no tracker is found 2013-02-20 16:17:55 +01:00
Daniel Schierbeck
1879a33865 Allow registering custom dependency trackers 2013-02-20 16:17:55 +01:00
Prem Sichanugrist
c9909db9f2 Remove XML Parser from ActionDispatch
If you want an ability to parse XML parameters, please install
`actionpack-xml_parser` gem.
2013-02-20 08:46:44 -05:00
Brian McManus
5c73f0d398 Fix time_zone_options_for_select to not mutate TimeZones array
Previous implementation of time_zone_options_for_select did not dup the
ActiveSupport::TimeZone.all array.  When :priority_zones were provided
the method would reject! the zones from the memoized TimeZones array
thus affecting future requests to the server.  Essentially whatever
zones were specified as :priority_zones would show up for the first
request but then disappear from the time zone options on future
requests.
2013-02-19 17:51:23 -08:00
Santiago Pastorino
00147c8762 InvalidMessage is in ActiveSupport::MessageEncryptor namespace
Closes #9302
2013-02-19 10:35:06 -02:00
Carlos Antonio da Silva
66237cd2b7 Fix AP tests related to routes inspector output and the new column titles 2013-02-19 08:58:29 -03:00
Aaron Patterson
9d023c87de Merge pull request #8704 from senny/remove_regexp_global_from_url_for
replace regexp global in #url_for
2013-02-14 09:59:16 -08:00
Carlos Antonio da Silva
759679289e Merge pull request #9221 from thenickcox/image_alt_attribute
Improve img alt attribute for screen readers
2013-02-11 04:21:53 -08:00
thenickcox
dd9f8bc847 Improve img alt attribute for screen readers
Currently, the img_alt method in ActionView keeps underscores
in the alt attribute. Because underscores are pronounced in
Apple's VoiceOver Utility, this has serious implications for
accessibility. This patch makes underscored or hyphenated file
names (both common in projects) read more naturally in screen
readers by replacing them with spaces. See method documentation
for details.

Added documentation to image_alt method
2013-02-09 20:29:52 -08:00
Yves Senn
9e10d59199 the :controller option for routes can contain numbers. closes #9231. 2013-02-09 22:30:43 +01:00
Andrey Chernih
4127332a5f Fix #9168 Initialize NullCookieJar with all options needed for KeyGenerator 2013-02-08 22:22:16 +04:00
Yves Senn
69f28a7d8d ruby constant syntax is not supported as routing :controller option.
The current implementation only works correctly if you supply the `:controller`
with directory notation (eg. `:controller => 'admin/posts'`).

The ruby constant notation (eg. `:controller => 'Admin::Posts`) leads to unexpected problems with `url_for`.

This patch prints a warning for every non supported `:controller` option. I also added documentation how
to work with namespaced controllers. The warning links to that documentation in the rails guide.
2013-02-06 20:56:09 +01:00
Yves Senn
cce94e7232 partials inside directory work with assert_template
previously when a partial was placed inside a directory
(eg. '/dir/_partial'), `assert_template` did not replace
the '_' prefix when looking through rendered tempaltes,
which resulted in an error.

I modified it to replace both, the leading '_' and the last '_'
after a '/'.
2013-02-04 14:46:50 +01:00
Yves Senn
c21ab338cb descriptive assert_template error when partial wasn't rendered
When `assert_template` is used with the :locals option, and the
partial was not rendered, a method_missing error was raised.
This changes first checks, if the partial actually was rendered
and raises a descriptive error.
2013-02-04 14:46:50 +01:00
Akira Matsuda
9c1cd6b142 Missing or unneeded require extract_options 2013-02-01 12:10:58 +09:00
Semyon Perepelitsa
540ebe37cd Fix content_tag_for with array html option.
It would embed array as string instead of joining it like `content_tag` does:

    content_tag(:td, class: ["foo", "bar"]){}
    #=> '<td class="foo bar"></td>'

Before:

    content_tag_for(:td, item, class: ["foo", "bar"]){}
    #=> '<td class="item [&quot;foo&quot;, &quot;bar&quot;]" id="item_1"></td>'

After:

    content_tag_for(:td, item, class: ["foo", "bar"]){}
    #=> '<td class="item foo bar" id="item_1"></td>'
2013-01-31 01:28:57 +08:00
Guillermo Iguaran
54a90a4794 Add 'X-UA-Compatible' => 'chrome=1' to default headers 2013-01-29 14:55:03 -05:00
Guillermo Iguaran
3bccd12373 Remove BestStandardsSupport middleware 2013-01-29 14:20:58 -05:00
Brendon Murphy
c302741d8f Remove yaml Proc param parser test
I don't believe this test is exercising any explicit params_parser
behavior that the other two Proc tests aren't already doing.  Given
that we now know it's a bad idea to load user input via YAML.load,
somebody reading this test might get a dangerous idea about building
out a YAML params parser.
2013-01-28 23:18:16 -08:00
Michiel Sikkes
f7277d99bf Make current_url? work with a HEAD method
ActionDispatch::Head was removed in favor of Rack::Head. But Rack::Head
does not convert GET requests to HEAD requests so we need to do
checking for HEAD requests ourselves.
2013-01-28 21:18:57 +01:00
Santiago Pastorino
5f5a43e2f7 Merge pull request #9032 from firmhouse/head-breaks-csrf
Make HEAD work / convert to GET once more
2013-01-28 07:25:20 -08:00
Akira Matsuda
5f30b547c8 Use Encoding::UTF_8 constant 🚯 2013-01-28 17:06:02 +09:00
Aaron Patterson
789df3be3e add fetch to CookieJar 2013-01-27 14:17:56 -08:00
Carlos Antonio da Silva
9df25844ba Add keys/values methods to TestSession
Bring back the same API we have with Request::Session.
2013-01-25 19:15:32 -02:00