Commit Graph

973 Commits

Author SHA1 Message Date
Santiago Pastorino
399b493cb4 content_tag_string shouldn't escape_html if escape param is false 2010-06-07 15:31:11 -04:00
José Valim
5273bd97e6 Make AP test suite green once again and speed up performance in layouts lookup for some cases. 2010-06-07 10:13:41 +02:00
wycats
0078df6b54 Update template to allow handlers to more cleanly handle encodings (ht: nex3) 2010-05-30 11:37:35 +02:00
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
Michael Koziarski
668f7dd5d0 Merge commit 'mislav/auto_link' 2010-05-29 14:05:56 +12: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
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 05c95b5c5815c0b3ae55fda7a897922b7f3ec2c7.

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
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
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
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
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
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
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
wycats
0fe8827bf3 Merge branch 'master' of github.com:rails/rails 2010-04-30 11:17:58 -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
wycats
91963e9e33 Merge branch 'master' of github.com:rails/rails 2010-04-26 23:32:30 -07:00
Jeremy Kemper
403752e289 Explicit source encoding 2010-04-24 18:35: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
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
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
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
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
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
36f3634a6a Add a test that used to fail but is fixed now [#3417 state:resolved] 2010-04-12 21:57:40 -07: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
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