diff options
author | wycats <wycats@gmail.com> | 2010-05-16 10:25:55 +0400 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-05-16 22:44:43 +0400 |
commit | 64d109e3539ad600f58536d3ecabd2f87b67fd1c (patch) | |
tree | 4b1deedbd5e33dd5410b1a37e9895f7a254c751a /actionpack/test/controller | |
parent | af0d1a88157942c6e6398dbf73891cff1e152405 (diff) | |
download | rails-64d109e3539ad600f58536d3ecabd2f87b67fd1c.tar.gz rails-64d109e3539ad600f58536d3ecabd2f87b67fd1c.tar.bz2 rails-64d109e3539ad600f58536d3ecabd2f87b67fd1c.zip |
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
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/assert_select_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/capture_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/render_test.rb | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/test/controller/assert_select_test.rb b/actionpack/test/controller/assert_select_test.rb index 7012c4c9b0..4f8ad23174 100644 --- a/actionpack/test/controller/assert_select_test.rb +++ b/actionpack/test/controller/assert_select_test.rb @@ -212,12 +212,12 @@ class AssertSelectTest < ActionController::TestCase assert_nothing_raised { assert_select "div", "bar" } assert_nothing_raised { assert_select "div", /\w*/ } assert_nothing_raised { assert_select "div", :text => /\w*/, :count=>2 } - assert_raise(Assertion) { assert_select "div", :text=>"foo", :count=>2 } + assert_raise(Assertion) { assert_select "div", :text=>"foo", :count=>2 } assert_nothing_raised { assert_select "div", :html=>"<span>bar</span>" } assert_nothing_raised { assert_select "div", :html=>"<span>bar</span>" } assert_nothing_raised { assert_select "div", :html=>/\w*/ } assert_nothing_raised { assert_select "div", :html=>/\w*/, :count=>2 } - assert_raise(Assertion) { assert_select "div", :html=>"<span>foo</span>", :count=>2 } + assert_raise(Assertion) { assert_select "div", :html=>"<span>foo</span>", :count=>2 } end end diff --git a/actionpack/test/controller/capture_test.rb b/actionpack/test/controller/capture_test.rb index d1dbd535c4..47253f22b8 100644 --- a/actionpack/test/controller/capture_test.rb +++ b/actionpack/test/controller/capture_test.rb @@ -68,6 +68,6 @@ class CaptureTest < ActionController::TestCase private def expected_content_for_output - "<title>Putting stuff in the title!</title>\n\nGreat stuff!" + "<title>Putting stuff in the title!</title>\nGreat stuff!" end end diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 52049f2a8a..2b1f2a27df 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -1079,7 +1079,7 @@ class RenderTest < ActionController::TestCase def test_action_talk_to_layout get :action_talk_to_layout - assert_equal "<title>Talking to the layout</title>\n\nAction was here!", @response.body + assert_equal "<title>Talking to the layout</title>\nAction was here!", @response.body end # :addressed: @@ -1096,7 +1096,7 @@ class RenderTest < ActionController::TestCase def test_yield_content_for assert_not_deprecated { get :yield_content_for } - assert_equal "<title>Putting stuff in the title!</title>\n\nGreat stuff!\n", @response.body + assert_equal "<title>Putting stuff in the title!</title>\nGreat stuff!\n", @response.body end def test_overwritting_rendering_relative_file_with_extension |