Commit Graph

2851 Commits

Author SHA1 Message Date
David Heinemeier Hansson
585f8f27b1 Fixed double output from cache in no caching mode 2010-06-08 14:47:02 -04:00
Prem Sichanugrist
c6ad64394b Make sure that rails recognized the full notation of IPv6 loopback address, and recognize 127.0.0.0/8 in IPv4
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 19:45:40 +02:00
Andrew White
a7edddf605 Fix resources ignoring scope options
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 19:33:27 +02:00
rohit
47bf19c848 Made markdown honor :safe option and handle safe input. Also added tests for markdown.
[#4794 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 17:00:11 +02:00
Andrew White
4740fbac85 Add support for actions on a new resource to the new routing DSL [#4328 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 09:11:39 +02:00
rohit
67f411c57b Fixed textilize_without_paragraph and added tests for it. [#4792 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 09:11:34 +02:00
Mikel Lindsaar
e404490f9b Merge branch 'master' of git://github.com/rails/rails 2010-06-08 00:10:11 -04:00
Mikel Lindsaar
21cc1ed437 Updating image_tag to support cid:content_id "URLs" 2010-06-07 21:53:31 -04:00
Diego Carrion
67a60ee314 Add shallow routes to the new router [Closes #3765] 2010-06-07 18:09:20 -05:00
José Valim
981f81275b Fix case when rendering a partial inside RJS with inherited layout [#4786 state:resolved] 2010-06-07 22:22:54 +02:00
Santiago Pastorino
ab764ecbfe Makes text_helper methods sanitize the input if the input is not safe or :safe => true option is not provided 2010-06-07 15:31:21 -04:00
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
1a8f784a23 member on resource should not expect an ID. 2010-06-07 11:20:54 +02: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
Rizwan Reza
ac9f8e1b7b Router accepts member routes on resource. [#4624 state:resolved] 2010-06-06 21:27:52 -04:00
José Valim
9a93844aba Add :only and :except to controllers MiddlewareStack. This allows
you to do the following:

  class PostsController < ApplicationController
    use AutheMiddleware, :except => [:index, :show]
  end
2010-05-30 15:53:14 +02:00
wycats
0078df6b54 Update template to allow handlers to more cleanly handle encodings (ht: nex3) 2010-05-30 11:37:35 +02:00
José Valim
19d8c8cbe4 Remove the laziness from the middleware stack. 2010-05-29 22:29:46 +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
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
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
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
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