Commit Graph

5488 Commits

Author SHA1 Message Date
wycats
d7f6f2b596 Now that we always return a proxy from mb_chars, even in 1.9, all Strings coming back from AS are UTF-8. 2010-05-29 21:20:52 +02:00
Santiago Pastorino
e5a56eb297 fix translation test in actionpack [#4701 state:commited]
Signed-off-by: wycats <wycats@gmail.com>
2010-05-29 21:12:28 +02:00
wycats
45e60283e7 Removing Metal from Rails 3.
If you have existing Metals, you have a few options:
* if your metal behaves like a middleware, add it to the
  middleware stack via config.middleware.use. You can use
  methods on the middleware stack to control exactly where
  it should go
* if it behaves like a Rack endpoint, you can link to it
  in the router. This will result in more optimal routing
  time, and allows you to remove code in your endpoint
  that matches specific URLs in favor of the more powerful
  handling in the router itself.

For the future, you can use ActionController::Metal to get
a very fast controller with the ability to opt-in to specific
controller features without paying the penalty of the full
controller stack.

Since Rails 3 is closer to Rack, the Metal abstraction is
no longer needed.
2010-05-29 20:08:00 +02:00
Michael Koziarski
668f7dd5d0 Merge commit 'mislav/auto_link' 2010-05-29 14:05:56 +12:00
Xavier Noria
ddec74fb3a Merge remote branch 'rails/master' 2010-05-27 10:57:05 +02:00
David Chelimsky
e02db06ece In AV::TC, move protect_against_forgery? from the test_case to the
_helper module included in the view.

- ensures that protect_against_forgery? is present when a helper
  included in a partial that is rendered by the template under test
  calls it (which happens in FormTagHelper#extra_tags_for_form, for
  example).

[#4700 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-26 15:59:03 +02:00
David Chelimsky
9ae7e93920 reorganize tests for AV::TC
- decouple tests from the test case class by moving them outside
- split out more TestCase subs as cleaner way of avoiding bleed of
  class level concepts

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-26 15:58:53 +02:00
David Chelimsky
163152bfd0 Support configuration of controller.controller_path on instances of
ActionView::TestCase::TestController without stubs. Just say:

  @controller.controller_path = "path/i/need/for/this/test"

[#4697 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-26 08:49:57 +02:00
David Chelimsky
0855e04044 fix small doc bug about running single unit test files 2010-05-25 19:14:11 +10:00
Jeremy Kemper
f53a6d8149 i18n: t() handles single keys returning an Array, also 2010-05-24 20:30:21 -07:00
Jeremy Kemper
d8d38bedfd HTML safety: fix textarea with nil content 2010-05-24 20:18:25 -07:00
Santiago Pastorino
b5f9c8822d translate method doesn't support arrays anymore and is optimized to be used with strings or symbols
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-24 23:42:20 +02:00
Santiago Pastorino
2b8eb5404e Revert "translation method for arrays on TranslationHelper module returns an array where values for keys of the form (.|_)html keys are html_safe"
This reverts commit 05c95b5c58.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-24 23:41:55 +02:00
David Chelimsky
8e583b69e8 Move AV::TC to AV::TC::Behavior [#4678 state:resolved]
- enables alternative testing frameworks to include AV::TC::Behavior
  instead of subclassing AV::TC
- also added tests and code for:
  - test view delegates :notice to request.flash
    - useful since generators generate views that use notice
  - test case doesn't try to include modules that are actually
    classes

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-24 22:58:46 +02:00
Santiago Pastorino
05c95b5c58 translation method for arrays on TranslationHelper module returns an array where values for keys of the form (.|_)html keys are html_safe
[#4675]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-24 20:12:43 +02:00
José Valim
59d1c418be Fix a bug where responders were not working properly on method override. 2010-05-24 13:12:40 +02:00
Mislav Marohnić
8f0b2138ee avoid auto_linking already linked emails; more robust detection of linked URLs
References #1523  [#1862 state:resolved]  [#3591 state:resolved]

Add test that shows how link text can contain HTML if needed:
the trick is using block form in combination with `raw`.
Let link text be automatically HTML-escaped

[#2017 state:resolved]
2010-05-24 11:25:24 +02:00
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
Rohit Arondekar
0244b43ecd Minor typo fix in callbacks.rb of abstract_controller 2010-05-20 03:23:21 -07:00
Xavier Noria
7f07cc364a Merge remote branch 'rails/master' 2010-05-19 23:29:39 +02:00
Santiago Pastorino
59c7b0c23a Avoid instance variable @output_buffer not initialized
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-19 12:59:29 +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
Marius Nuennerich
aa4fe9fb33 fix documentation typo
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-05-18 19:29:17 -03:00
José Valim
d3e62fc57c Avoid creating a Rack::Response object in the cookie middleware since it may stream the body. 2010-05-18 17:47:56 +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
0c3cde404a Kill legacy dispatcher. 2010-05-18 02:07:59 +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
c3b7471c69 Merge branch 'encodings' 2010-05-17 19:42:00 +04:00
wycats
80b60671f7 Revert "Moved encoding work in progress to a feature branch."
This reverts commit ade756fe42.
2010-05-17 19:41:54 +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
a06e9b4602 Ruby 1.9: helper path may be a pathname, so convert to a string before quoting for regexp 2010-05-16 18:03:27 -07:00
Rizwan Reza
d148a6f6ba Merge branch 'master' of git://github.com/rails/rails 2010-05-17 02:40:15 +04:30
Jeremy Kemper
ade756fe42 Moved encoding work in progress to a feature branch.
This reverts commits af0d1a8815 and 64d109e353.
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
wycats
af0d1a8815 Initial work to improve the state of encodings for templates 2010-05-16 22:43:35 +04:00
Rizwan Reza
d61dbce482 Take out stale tasks from Actionpack's Rakefile [#4619 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 17:49:33 +02: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
José Valim
f055bc05d5 Optimize the code added in fa99de0bd0 2010-05-15 21:55:03 +02:00
Jeremy Kemper
c5537c1158 Ruby 1.9: fix invalid rack response in test 2010-05-15 11:25:56 -07:00