From b8470e3c046dd6d920723446d10961998f2aef22 Mon Sep 17 00:00:00 2001 From: JoenioCosta Date: Sat, 26 Apr 2008 17:55:31 +0000 Subject: [PATCH] ActionItem192: simplifying assert_sanitized method --- test/test_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index f9ac165..8245866 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -187,9 +187,9 @@ class Test::Unit::TestCase end - # this check only if string has html tag - def assert_sanitized(string) - assert_no_match /<[^>]+\/?>/, string, "String #{string} expected to be sanitized" + # this check only if text has html tag + def assert_sanitized(text) + assert !text.index('<'), "Text '#{text}' expected to be sanitized" end private -- libgit2 0.21.2