Commit Graph

5678 Commits

Author SHA1 Message Date
José Valim 06681af518 A couple enhancements to the router:
* Allow to use the get :symbol shortcut outside resources scopes as well;

* Fix a bug where :action was not being picked from given options;

* Giving :as option inside a resource now changes just the relative name instead of the full name;
2010-06-30 12:34:15 +02:00
José Valim ccbb3bb3d8 Clean up the logic to specify the name and path for action a bit. 2010-06-30 11:33:15 +02:00
Santiago Pastorino 7bd00fcb7f We are trying to test that & escapes here not that & is being escaped, also added a cosmetic change to test_link_tag_with_query_and_no_name
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-29 18:01:32 -07:00
Xavier Noria ec3bfa2ead s/escape_once/html_escape/, since html safety is the contract that now says whether something has to be escaped 2010-06-30 00:32:26 +02:00
Xavier Noria cba1460a2f url_for no longer escapes HTML, the :escape option is also gone
Rationale: url_for is just a path/URL generator, it is the responsability of the caller to escape conveniently HTML needs it, JavaScript needs different escaping, a text mail needs no escaping at all, etc.
2010-06-30 00:23:13 +02:00
wycats b1cc63c10d _snowman CHANGELOG (dobry pies) 2010-06-29 12:23:11 -07:00
Jeremy Kemper 7ea85ff516 Revert "Revert "Name compiled render methods". This caused several failures on AP test suite for 1.9.2."
This reverts commit 9013227e00.

minitest was 'running' compiled templates beginning with test!
2010-06-29 09:22:53 -07:00
José Valim caab176116 Rename _snowman_ to _snowman to be in sync with _method and _csrf_token. 2010-06-29 18:02:39 +02:00
José Valim 9013227e00 Revert "Name compiled render methods". This caused several failures on AP test suite for 1.9.2.
This reverts commit 2c4f8aae5c.
2010-06-29 10:54:07 +02:00
Jeremy Kemper f8011e67b0 Use caller for helpers_dir deprecation warnings 2010-06-28 14:48:44 -07:00
Jeremy Kemper b3318bd937 Slice new buffer from beginning of old buffer to skip encoding special case 2010-06-28 14:46:23 -07:00
Jeremy Kemper 2c4f8aae5c Name compiled render methods 2010-06-28 14:46:23 -07:00
Jeremy Kemper 198ec03f52 returning -> tap 2010-06-28 14:46:23 -07:00
Jeremy Kemper ec18719b81 ETag: use body instead of @body since the method will always return a string 2010-06-28 14:46:22 -07:00
José Valim 6dfa8d8e95 Tidy up valid conditions in router a bit. 2010-06-28 16:57:14 +02:00
Andrew White 02a1a4edc8 Add :controller and :action to the list of valid conditions
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 16:51:39 +02:00
Andrew White 0b6ce34223 Restores the escaping of urls generated from hashes. [#4765 state:resolved]
HTML specifications recommend the escaping of urls in web pages,
which url_for does by default for string urls and consquently
urls generated by path helpers as these return strings.

Hashes passed to url_for are not escaped by default and this
commit reverses this default so that they are escaped.

Undoes the changes of this commit:
1b3195b63c

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 15:35:38 +02:00
Andrew White e717631a84 Merge :constraints from scope into resource options [#2694 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 14:22:35 +02:00
rohit ccb21f20d8 Convert instance_variables to symbols before excluding internal vars [#4965 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 13:27:06 +02:00
Andrew White 19ccd4628c Remove invalid conditions from route [#4989 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 12:25:19 +02:00
José Valim 6d04fa6dc4 Deprecate the old router DSL. Since it is still used intensively across ActionPack test suite, patches that translates Rails internal tests to the new router DSL are welcome (note though that a few tests shouldn't be translated since they are testing exactly the old mapper API, like the ones in actionpack/test/controller/resource_test.rb and actionpack/test/controller/routing_test.rb) 2010-06-28 12:23:41 +02:00
Bruno Michel 2002e5877e Strip_tags never ending attribute should not raise a TypeError [#4870 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 11:40:27 +02:00
José Valim dd8b7417a9 Update CHANGELOGs. 2010-06-28 11:37:14 +02:00
wycats 6fe424aeca Small typo 2010-06-27 21:50:33 -07:00
wycats 25215d7285 Fix several known web encoding issues:
* Specify accept-charset on all forms. All recent browsers,
  as well as IE5+, will use the encoding specified for form
  parameters
* Unfortunately, IE5+ will not look at accept-charset unless
  at least one character in the form's values is not in the
  page's charset. Since the user can override the default
  charset (which Rails sets to UTF-8), we provide a hidden
  input containing a unicode character, forcing IE to look
  at the accept-charset.
* Now that the vast majority of web input is UTF-8, we set
  the inbound parameters to UTF-8. This will eliminate many
  cases of incompatible encodings between ASCII-8BIT and
  UTF-8.
* You can safely ignore params[:_snowman_]

TODO:

* Validate inbound text to confirm it is UTF-8
* Combine the whole_form implementations in form_helper_test
  and form_tag_helper_test
2010-06-27 21:13:55 -07:00
Jeremy Kemper f3bb185b03 Upgrade to Rack 1.2.1 2010-06-27 17:55:23 -07:00
Jeremy Kemper 6549291901 Vendor unreleased rack-mount 0.6.6.pre dependency 2010-06-27 16:28:04 -07:00
Santiago Pastorino 3ab296fd59 AV::logger returns AC::logger if it's defined, workaround meanwhile AV doesn't have it's own logger
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 01:26:17 +02:00
Santiago Pastorino 824da60ae8 Move Rails module to abstract_unit to make test in isolation work
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 01:26:07 +02:00
Michael Lovitt ebee77a28a Fixed that an ArgumentError is thrown when request.session_options[:id] is read in the following scenario: when the cookie store is used, and the session contains a serialized object of an unloaded class, and no session data accesses have occurred yet. Pushed the stale_session_check responsibility out of the SessionHash and down into the session store, closer to where the deserialization actually occurs. Added some test coverage for this case and others related to deserialization of unloaded types.
[#4938]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-27 22:39:06 +02:00
Andrew White 91b52c795f Normalize recall params when the route is not a standard route otherwise :controller and :action may appear in the generated url [#4326 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-27 09:23:36 +02:00
David Trasbo 0abf4b0746 Change reference to Test::Unit::AssertionFailedError to the generic ActiveSupport::TestCase::Assertion [#4987 state:commited]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-26 18:45:20 -07:00
José Valim 7eb5766bd1 Small changes to responder:
* resources is always an array;
* Lazy retrieve request and formats;
* Alias api_location and navigation_location to resource_location, making easier to change its behavior without affecting each other and without a need to reimplement any of the behavior methods.
2010-06-26 15:48:47 +02:00
Andrew White d4e1a2ef0d Support optional static segements as well [#4832 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 12:02:29 +02:00
Paul Barry 59b24ceb0c Fixed normalize_path in Routing::Mapper to handle optional prefix segments with static and dynamic parts
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 12:02:24 +02:00
Andrew White 9a6fc9a540 Don't force pluralization of controller name when defining a resource [#4980 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 10:16:30 +02:00
Andrew White bba19603c2 URL fragments should not have safe characters escaped. Ref: Appendix A, http://tools.ietf.org/rfc/rfc3986.txt
[#4762 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-25 18:05:40 -07:00
Andrew White 5f64bce10f Failing test for whether glob parameters accept regexps
[#4970 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-25 10:17:28 -07:00
Andrew White 3d8200318a Add failing test case for parameters with periods
[#2536 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-25 10:12:11 -07:00
José Valim 01472b5217 Do not mark the session as loaded if an error happened while doing it. 2010-06-25 19:03:00 +02:00
José Valim 21c99e9388 Calling exists? in the session store, without checking for stale sessions, was causing the cookie store to panic because we need to unpack the whole session to get its key. This commit fixes this issue and also caches exists calls for performance improvements. 2010-06-25 12:15:17 +02:00
Carlos Antonio da Silva b01df28413 Do not wrap hidden fields with error proc [#4962 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-25 09:49:29 +02:00
Prem Sichanugrist 617e94658d Make sure that Rails doesn't resent session_id cookie over and over again if it's already there [#2485 state:resolved]
This apply to only Active Record store and Memcached store, as they both store only the session_id, which will be unchanged, in the cookie.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-25 09:41:52 +02:00
José Valim a12b76b09e Just reading flash messages should not create a session if one does not exist yet. 2010-06-25 09:36:26 +02:00
José Valim d69ebb849a Avoid deserializing cookies too early, which causes session objects to not be available yet. Unfortunately, could not reproduce this in a test case. 2010-06-24 20:03:03 +02:00
Andrew White df15ba7ead Fix namespaced redirects [#4389 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-24 13:26:24 +02:00
José Valim 6788db824a Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved] 2010-06-24 13:23:43 +02:00
José Valim 69abbe8934 Avoid using Pathname on Resolver and AS::Dependencies. 2010-06-24 01:06:37 +02:00
Michael Lovitt 49f52c3d91 Sessions should not be created until written to and session data should be destroyed on reset.
[#4938]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-23 11:56:35 -07:00
David Chelimsky 32b8be9533 Expose view via the view() method in AV::TestCase::Behavior
- was exposed as _view, which suggested it was private
- left _view as an alias of view as not to break any extensions that are
  relying on _view

[#4932 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 17:45:48 +02:00