diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-29 20:00:10 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-29 20:00:10 -0700 |
commit | d0d02bffe8dd12dcb2d113a60a6790d7a88e78be (patch) | |
tree | c0d1fba0790252e074c4a1c11f9dacd5eacc8ac5 /actionpack/test/controller/action_pack_assertions_test.rb | |
parent | f655108c260ccd334e494b7d6da8822b31cc2156 (diff) | |
parent | 19dff78d0202303f7559921f24b9801722695f33 (diff) | |
download | rails-d0d02bffe8dd12dcb2d113a60a6790d7a88e78be.tar.gz rails-d0d02bffe8dd12dcb2d113a60a6790d7a88e78be.tar.bz2 rails-d0d02bffe8dd12dcb2d113a60a6790d7a88e78be.zip |
Merge pull request #7659 from HugoLnx/template_error_no_matches_rebased
REBASED: fixing assert_template bug when template matches expected, but not ends with
Diffstat (limited to 'actionpack/test/controller/action_pack_assertions_test.rb')
-rw-r--r-- | actionpack/test/controller/action_pack_assertions_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index 4ab5d92a2b..ca542eb7e2 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -7,6 +7,7 @@ class ActionPackAssertionsController < ActionController::Base def nothing() head :ok end def hello_world() render :template => "test/hello_world"; end + def hello_repeating_in_path() render :template => "test/hello/hello"; end def hello_xml_world() render :template => "test/hello_xml_world"; end @@ -464,6 +465,20 @@ class AssertTemplateTest < ActionController::TestCase end end + def test_fails_with_incorrect_string_that_matches + get :hello_world + assert_raise(ActiveSupport::TestCase::Assertion) do + assert_template 'est/he' + end + end + + def test_fails_with_repeated_name_in_path + get :hello_repeating_in_path + assert_raise(ActiveSupport::TestCase::Assertion) do + assert_template 'test/hello' + end + end + def test_fails_with_incorrect_symbol get :hello_world assert_raise(ActiveSupport::TestCase::Assertion) do @@ -471,6 +486,13 @@ class AssertTemplateTest < ActionController::TestCase end end + def test_fails_with_incorrect_symbol_that_matches + get :hello_world + assert_raise(ActiveSupport::TestCase::Assertion) do + assert_template :"est/he" + end + end + def test_fails_with_wrong_layout get :render_with_layout assert_raise(ActiveSupport::TestCase::Assertion) do |