aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorDavid Chelimsky <dchelimsky@gmail.com>2010-05-04 09:00:46 -0500
committerJosé Valim <jose.valim@gmail.com>2010-05-24 22:58:46 +0200
commit8e583b69e8b3017e85440c97b325ca7ae0c32dfb (patch)
tree43d435fb66805c69cb7988a8cdb3f27dfbf48134 /actionpack/test/template
parent05c95b5c5815c0b3ae55fda7a897922b7f3ec2c7 (diff)
downloadrails-8e583b69e8b3017e85440c97b325ca7ae0c32dfb.tar.gz
rails-8e583b69e8b3017e85440c97b325ca7ae0c32dfb.tar.bz2
rails-8e583b69e8b3017e85440c97b325ca7ae0c32dfb.zip
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>
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/test_case_test.rb14
1 files changed, 14 insertions, 0 deletions
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