diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-26 20:43:35 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-26 20:43:35 +0100 |
commit | dc57d545bb3e8ff4123892e5e311e658ab506252 (patch) | |
tree | 8dee5b543ee1830bbe87a38771c9bf1c352a8d72 /actionpack/test | |
parent | 9f63c4b26e6afe04849dc906b52177ba5221e3b7 (diff) | |
download | rails-dc57d545bb3e8ff4123892e5e311e658ab506252.tar.gz rails-dc57d545bb3e8ff4123892e5e311e658ab506252.tar.bz2 rails-dc57d545bb3e8ff4123892e5e311e658ab506252.zip |
Fix t('.helper').
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/helper_test.rb | 21 | ||||
-rw-r--r-- | actionpack/test/fixtures/test/translation.erb | 1 | ||||
-rw-r--r-- | actionpack/test/template/translation_helper_test.rb | 10 |
3 files changed, 17 insertions, 15 deletions
diff --git a/actionpack/test/controller/helper_test.rb b/actionpack/test/controller/helper_test.rb index 75a96d6497..e53e62d1ff 100644 --- a/actionpack/test/controller/helper_test.rb +++ b/actionpack/test/controller/helper_test.rb @@ -135,16 +135,17 @@ class HelperTest < ActiveSupport::TestCase assert methods.include?('foobar') end - def test_deprecation - assert_deprecated do - ActionController::Base.helpers_dir = "some/foo/bar" - end - assert_deprecated do - assert_equal ["some/foo/bar"], ActionController::Base.helpers_dir - end - ensure - ActionController::Base.helpers_path = [File.dirname(__FILE__) + '/../fixtures/helpers'] - end + # TODO Add this deprecation back before Rails 3.0 final release + # def test_deprecation + # assert_deprecated do + # ActionController::Base.helpers_dir = "some/foo/bar" + # end + # assert_deprecated do + # assert_equal ["some/foo/bar"], ActionController::Base.helpers_dir + # end + # ensure + # ActionController::Base.helpers_path = [File.dirname(__FILE__) + '/../fixtures/helpers'] + # end private def expected_helper_methods diff --git a/actionpack/test/fixtures/test/translation.erb b/actionpack/test/fixtures/test/translation.erb new file mode 100644 index 0000000000..81a837d1ff --- /dev/null +++ b/actionpack/test/fixtures/test/translation.erb @@ -0,0 +1 @@ +<%= t('.helper') %>
\ No newline at end of file diff --git a/actionpack/test/template/translation_helper_test.rb b/actionpack/test/template/translation_helper_test.rb index d67d2c7911..4b73c44f7e 100644 --- a/actionpack/test/template/translation_helper_test.rb +++ b/actionpack/test/template/translation_helper_test.rb @@ -1,9 +1,9 @@ require 'abstract_unit' -class TranslationHelperTest < Test::Unit::TestCase +class TranslationHelperTest < ActiveSupport::TestCase include ActionView::Helpers::TagHelper include ActionView::Helpers::TranslationHelper - + attr_reader :request def setup end @@ -25,8 +25,8 @@ class TranslationHelperTest < Test::Unit::TestCase end def test_scoping_by_partial - expects(:template).returns(stub(:path_without_format_and_extension => "people/index")) - I18n.expects(:translate).with("people.index.foo", :locale => 'en', :raise => true).returns("") - translate ".foo", :locale => 'en' + I18n.expects(:translate).with("test.translation.helper", :raise => true).returns("helper") + @view = ActionView::Base.new(ActionController::Base.view_paths, {}) + assert_equal "helper", @view.render(:file => "test/translation") end end |