Commit Graph

2869 Commits

Author SHA1 Message Date
Mislav Marohnić
133ada6ab0 auto_link: support arbitrary URI schemes like "ftp:" and "file:"
recognizes all URI scheme allowed characters, such as colon and period.

[#3494 state:resolved]
2010-05-24 11:25:24 +02:00
Santiago Pastorino
aacf2581cd refactor evals and adds some __FILE__ and __LINE__
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-20 15:18:57 +02:00
Neeraj Singh
b462952886 Use better assertion methods for testing
[#4645 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-19 10:18:36 +02:00
José Valim
c536835957 Cut the fat and make session stores rely on request.cookie_jar and change set_session semantics to return the cookie value instead of a boolean. 2010-05-18 03:18:23 +02:00
Neeraj Singh
73f0e1a842 Use assert_respond_to because it has better error messaging
[#4628 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-18 02:12:06 +02:00
José Valim
26e645fa00 Remove deprecated methods since 2-3-stable. 2010-05-18 02:11:50 +02:00
José Valim
25f7c030e4 Simplify cookie_store by simply relying on cookies.signed. 2010-05-18 02:05:20 +02:00
José Valim
941b653627 Rely on set and delete cookie logic from rack. 2010-05-18 01:51:45 +02:00
wycats
f09d8f3e68 Merge remote branch 'origin/master' 2010-05-17 19:51:30 +04:00
wycats
02c36cf5cb Make sure encoding changes don't break 1.8 2010-05-17 19:39:38 +04:00
Santiago Pastorino
c7e6777961 Added default currency values to NumberHelper and pass them to I18n.translate
[#4604 state:committed]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-17 17:39:33 +02:00
José Valim
107c6381a0 Allow root to be given in the resources scope without need to specify :on => collection. 2010-05-17 17:39:32 +02:00
Jeremy Kemper
ade756fe42 Moved encoding work in progress to a feature branch.
This reverts commits af0d1a88157942c6e6398dbf73891cff1e152405 and 64d109e3539ad600f58536d3ecabd2f87b67fd1c.
2010-05-16 13:55:29 -07:00
wycats
64d109e353 Significantly improved internal encoding heuristics and support.
* Default Encoding.default_internal to UTF-8
* Eliminated the use of file-wide magic comments to coerce code evaluated inside the file
* Read templates as BINARY, use default_external or template-wide magic comments
  inside the Template to set the initial encoding
  * This means that template handlers in Ruby 1.9 will receive Strings encoded
    in default_internal (UTF-8 by default)
* Create a better Exception for encoding issues, and use it when the template
  source has bytes that are not compatible with the specified encoding
* Allow template handlers to opt-into handling BINARY. If they do so, they
  need to do some of their own manual encoding work
* Added a "Configuration Gotchas" section to the intro Rails Guide instructing
  users to use UTF-8 for everything
* Use config.encoding= in Ruby 1.8, and raise if a value that is an invalid
  $KCODE value is used

Also:
* Fixed a few tests that were assert() rather than assert_equal() and
  were caught by Minitest requiring a String for the message
* Fixed a test where an assert_select was misformed, also caught by
  Minitest being more restrictive
* Fixed a test where a Rack response was returning a String rather
  than an Enumerable
2010-05-16 22:44:43 +04:00
Simon Jefford
f58bdae1f7 Check blocks are not incorrectly detected when compiling erubis templates [#4575 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 15:05:07 +02:00
Hussein Morsy
4ea48f2a98 Fixed 1 failure in ActionPack testsuite [#4613 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 15:00:35 +02:00
pleax
2dc1402417 added support for html attributes in options_for_select [#2165]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 14:33:04 +02:00
rohit
fc2480a277 Fixed 1 failure and 2 errors in ActionPack testsuite [#4613 state:commited]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 14:32:53 +02:00
Jeff Dean
6617d01893 Sending :id => nil to form helpers now properly omits the "id" html element [#4559 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-15 22:30:21 +02:00
Jeremy Kemper
c5537c1158 Ruby 1.9: fix invalid rack response in test 2010-05-15 11:25:56 -07:00
Jeff Kreeftmeijer
fa99de0bd0 partial counters with :as [#2804 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-15 10:32:23 -07:00
Anil Wadghule
2d84f24af5 Add tests for convenience methods #notice and #alert to flash.now [#4369 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-15 16:52:23 +02:00
Paco Guzman
cdf700147c fix assert_select messages to its declaration behaviour
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-15 16:31:36 +02:00
Marc-Andre Lafortune
9869ee77cd Accept :alt => nil on image_tag [#4558 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-15 09:43:15 +02:00
José Valim
d18a2742e0 Improve previous patch a bit [#3645 state:resolved] 2010-05-15 09:08:40 +02:00
Stephen Celis
6e69b42b21 Let label helpers accept blocks.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-15 08:59:08 +02:00
José Valim
6c2d974e15 Use annoted source code in Template:Error to avoid special cases in the show exceptions middleware. 2010-05-09 12:52:30 +03:00
Lawrence Pit
1e1d30715e Fix parsing xml input by ActionDispatch::ParamsParser
[#4437 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-06 20:34:47 -07:00
David Chelimsky
b3dcbedc67 move assert_template tests to their own test case [#4501 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-03 13:46:34 +02:00
David Chelimsky
849ab92942 Eliminate false positives when passing symbols to assert_template
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-03 13:46:12 +02:00
Lawrence Pit
9bd91b00b8 Favor %{} in all code instead of (deprecated) {{}} as interpolation syntax for I18n
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-03 13:37:32 +02:00
David Chelimsky
8672a97e11 add NullResolver
[#4523 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:54 +02:00
David Chelimsky
a3044967ed add tests for FixtureResolver
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:54 +02:00
David Chelimsky
91125f9927 move FixtureResolver to a file that is accessible outside Rails' own tests
[#4522 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:54 +02:00
Carl Lerche
6c280f3398 RouteSet does not raise ActionController::RoutingError when no routes match anymore. Instead, it follows the X-Cascade convention. ShowExceptions checks for X-Cascade so that the routing error page can still be displayed. 2010-04-30 16:40:42 -07:00
Jeremy Kemper
1d2257deeb Merge remote branch 'technoweenie/http_token_authentication'
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-30 13:46:37 -07:00
wycats
0fe8827bf3 Merge branch 'master' of github.com:rails/rails 2010-04-30 11:17:58 -07:00
rick
8d236ccb84 add HTTP Token Authorization support to complement Basic and Digest Authorization. 2010-04-30 07:46:30 -07:00
Neeraj Singh
68c96fad55 Fix form builder and form helpers inconsistencies [#4432 state:resolved]
* datetime_select and select_datetime should be consistent as much as possible
* date_select and select_date should be consistent as much as possible
* time_select and select_time should be consistent as much as possible

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-29 13:40:55 +02:00
Neeraj Singh
d793d30776 ActionCachingTestController rescues from all exceptions. Making sure that all the tests check for valid response. [#4468 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-29 12:48:34 +02:00
wycats
91963e9e33 Merge branch 'master' of github.com:rails/rails 2010-04-26 23:32:30 -07:00
Anil Wadghule
53c13f1aca Use Config::CONFIG['host_os'] instead of RUBY_PLATFORM [#4477 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-26 11:12:52 -07:00
Cezary Baginski
490a3335d5 Action Pack: fix tests with -K*, work around Ruby 1.9.1 constant lookup.
[#4473 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-25 17:00:20 -07:00
Jeremy Kemper
df886c4c89 Missed commit: explicit source encoding 2010-04-24 18:52:51 -07:00
Jeremy Kemper
403752e289 Explicit source encoding 2010-04-24 18:35:12 -07:00
Santiago Pastorino
ed0ca5db9e Add a test for assert_recognizes on ActionDispatch::IntegrationTest [#4390 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-24 15:43:12 -07:00
Jeremy Kemper
72a3e4b77b Rename fieldWithErrors style to field_with_errors. Remove unused alert style. 2010-04-24 15:02:12 -07:00
José Valim
aaaa1782b4 Fix render :xml test (ht Simo Niemelä) 2010-04-24 11:48:47 +02:00
Nicolas Sanguinetti
d5d717161d Allow :remote => false to be passed to link_to
And add tests for `button_to` and `form_tag` which currently behave as
expected, so we avoid a regression.

Signed-off-by: wycats <wycats@gmail.com>
2010-04-22 15:29:59 -07:00
Santiago Pastorino
920df0a475 Make ActionDispatch url_for use HWIA symbolize_keys
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-22 09:06:55 -07:00
J Smith
275e839b8d Ensure that url_for uses symbolized keys in the controller. [#4391]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-22 16:47:36 +02:00
José Valim
81fb742488 Always downstream given options in :json, :xml and :js renderers and add tests for it. 2010-04-22 12:12:38 +02:00
José Valim
4163ccec23 Clean up the config object in ActionPack. Create config_accessor which just delegates to the config object, reducing the number of deprecations and add specific tests. 2010-04-22 12:00:13 +02:00
Santiago Pastorino
a8330c2006 params already has a setted controller and action here
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-21 17:46:37 -07:00
Santiago Pastorino
5c9c30ac65 url_for now works with HashWithIndifferentAccess ht jay [#4391 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-21 17:09:14 -07:00
Carl Lerche
d32a4cbaa5 Merge branch 'master' of github.com:rails/rails 2010-04-18 13:02:37 -07:00
Diego Carrion
8c7e8976e9 added shorthand support for routes like /projects/status(.:format)
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-17 17:53:08 -07:00
David Chelimsky
4327ad51ab access assigns as a method or hash, with strings or symbols [#4431 state:resolved] 2010-04-17 15:59:10 -04:00
Aaron Patterson
d4d352bf94 fisting codes so it will parse [#4430 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-04-17 15:57:36 -04:00
Santiago Pastorino
e85100da0a Added missing require 2010-04-16 23:44:39 -03:00
Sam Elliott
c16c248912 mail_to with :encode => :javascript now outputs safe html
Signed-off-by: Carl Lerche <carllerche@mac.com>
2010-04-16 15:53:55 -07:00
Kieran Pilkington
001ca893c6 Mark the result of grouped_options_for_select as HTML safe [#4322 state:committed]
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-04-16 15:05:41 -07:00
Santiago Pastorino
5699de1d15 Added test get to js should have a header with content-type text/javascript 2010-04-16 11:03:16 -03:00
Santiago Pastorino
8a8da68d1f Tidy up a bit this test file 2010-04-16 11:03:16 -03:00
Santiago Pastorino
462a7b45f6 Revert "Add test case which check content type when rendering rjs" partial in html template" rendering rjs in html doesn't make sense, it would just output javascript into the template, no script tag
This reverts commit dc251389d1ab4303b80a22642f4241940b73cbe7.
2010-04-16 11:03:16 -03:00
Santiago Pastorino and Carl Lerche
0ea434e2f4 Make perform_caching work again, with the tests passing and backward compatible 2010-04-15 18:25:08 -03:00
Craig Davey
5208cc3cf5 Changed translate helper so that it doesn’t mark every translation as safe HTML. Only keys with a "_html" suffix and keys named "html" are considered to be safe HTML. All other translations are left untouched.
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2010-04-13 17:35:10 -07:00
wycats
8e9df34fa3 Merge branch 'master' of github.com:rails/rails 2010-04-13 14:07:46 -07:00
Stanko Alexander
dc251389d1 Add test case which check content type when rendering rjs partial in html template
Signed-off-by: wycats <wycats@gmail.com>
2010-04-13 13:09:41 -07:00
Anil Wadghule
518891f490 Use correct RUBY_PLATFORM regex for Windows env [#4385 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-13 12:39:03 -07:00
wycats
36f3634a6a Add a test that used to fail but is fixed now [#3417 state:resolved] 2010-04-12 21:57:40 -07:00
José Valim
86defed5ad Fix a bug in url generation for generic routes. 2010-04-12 20:23:35 +02:00
José Valim
a8b1ca26d7 Ensure match path, :controller => name works as expected. 2010-04-12 16:49:41 +02:00
Ryan Bates
e5f392ce8f fields_for returns block result when outside ERB
Signed-off-by: wycats <wycats@gmail.com>
2010-04-11 19:26:00 -07:00
Santiago Pastorino
5b89fd07b2 Make namespace work with options[:to] [#4351 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-11 12:05:43 +02:00
José Valim
ece157e950 Move verification to a plugin as well: http://github.com/rails/verification.git 2010-04-10 11:47:20 +02:00
José Valim
cd79a46174 Remove input, form, error_messages_for and error_message_on from the framework. If you think you will miss them, feel free to use the dynamic_form plugin available at http://github.com/rails/dynamic_form 2010-04-10 10:53:05 +02:00
Jeremy Kemper
7353fc1595 Dial back from 'namespace :controller => ...' to 'scope :module => ...' 2010-04-09 23:09:15 -07:00
Jeremy Kemper
561d9eff0c Add test showing root match in path namespace 2010-04-09 22:12:06 -07:00
Jeremy Kemper
ac0280c39d Routes can be selectively namespaced by path or controller module 2010-04-09 21:48:35 -07:00
Santiago Pastorino
13e00ce606 fix stack trace lines on class_eval
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-09 21:28:49 +02:00
Jeremy Kemper
4691c696b0 Expect an incompatible encoding exception when a template with a magic comment renders a partial without one and its source encoding doesn't match the default external encoding 2010-04-08 20:22:07 -07:00
Jeremy Kemper
bd2bf5390d Expect an incompatible encoding exception when a template doesn't have a magic comment and its source encoding doesn't match the default external encoding 2010-04-08 19:27:39 -07:00
Xavier Noria
fd7202a756 adds #favicon_link_tag back, rdoc explains why it is useful, and how to get a link for Mobile Safari with it 2010-04-08 18:13:23 -07:00
Carl Lerche
99d5459921 Fixed that default locale templates should be used if the current locale template is missing [DHH] 2010-04-08 18:11:26 -07:00
Michael Koziarski
82514c2897 Add accessors for request and response so tests don't have to mess with internal ivars 2010-04-09 11:30:39 +12:00
David Heinemeier Hansson
5f808b865c Consistently use lowercase instead of camelCase for all JS class names in Rails 2010-04-08 12:17:46 -07:00
David Heinemeier Hansson
00ee9b3369 Revert "adds #favicon_link_tag and #apple_touch_icon_link_tag" -- these tags are too specific.
This reverts commit 6891f46d10957f21f200fc4dc2b6076ff411b1da, ec8610cfdc32d0fe816fb22405e00ef1b6c90d73, and  d18ff1b7efd96e7c08bc1a15137735be45f87e07.
2010-04-08 11:49:34 -07:00
Xavier Noria
ec8610cfdc adds a default source to #apple_touch_icon_link_tag 2010-04-07 13:20:52 -07:00
Xavier Noria
d18ff1b7ef new helpers #favicon_link_tag and #apple_touch_icon_link_tag 2010-04-07 13:04:52 -07:00
José Valim
eb063538bd Use config.filter_parameters on in-browser request dump. [#4335 state:resolved] 2010-04-07 01:42:51 +02:00
José Valim
46e2a44ee1 Rename search_field to test_search_field (ht: Piotr Usewicz) 2010-04-06 11:53:34 +02:00
David Heinemeier Hansson
f8730e5ce6 Added all the new HTML5 form types as individual form tag methods (search, url, number, etc) (Closes #3646) [Stephen Celis] 2010-04-05 16:07:44 -07:00
Joshua Peek
570c54c39a Fix cookie access in integration tests with other host names 2010-04-05 15:22:09 -07:00
Santiago Pastorino
d270da569e changed from :object_name to :as on form_for api 2010-04-05 18:55:37 -03:00
Santiago Pastorino
c6746ffaf4 deprecate form_for(symbol_or_string, ...) in favor of :object_name option 2010-04-05 17:47:02 -03:00
José Valim
6690d66292 Rename config.cookie_secret to config.secret_token and pass it as configuration in request.env. This is another step forward removing global configuration. 2010-04-05 12:00:24 +02:00
wycats
485512c50f Whitespace 2010-04-04 19:58:16 -07:00
wycats
209fb5190b render_to_string should have the identical signature as render 2010-04-04 19:58:15 -07:00
wycats
b546945b51 Reapply redirect {|params, request| } with passing tests this time 2010-04-04 13:17:14 -07:00