From 8e583b69e8b3017e85440c97b325ca7ae0c32dfb Mon Sep 17 00:00:00 2001 From: David Chelimsky Date: Tue, 4 May 2010 09:00:46 -0500 Subject: Move AV::TC to AV::TC::Behavior [#4678 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- actionpack/test/template/test_case_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'actionpack/test/template/test_case_test.rb') diff --git a/actionpack/test/template/test_case_test.rb b/actionpack/test/template/test_case_test.rb index c1a38a25de..a4fb9f22bf 100644 --- a/actionpack/test/template/test_case_test.rb +++ b/actionpack/test/template/test_case_test.rb @@ -48,6 +48,20 @@ module ActionView assert test_case.ancestors.include?(AnotherTestHelper) assert_equal 'Howdy!', from_another_helper end + + test "determine_default_helper_class returns nil if name.sub(/Test$/, '').constantize resolves to a class" do + assert_nil self.class.determine_default_helper_class("String") + end + + test "delegates notice to request.flash" do + _view.request.flash.expects(:notice).with("this message") + _view.notice("this message") + end + + test "delegates alert to request.flash" do + _view.request.flash.expects(:alert).with("this message") + _view.alert("this message") + end end class ClassMethodsTest < ActionView::TestCase -- cgit v1.2.3