Commit b8470e3c046dd6d920723446d10961998f2aef22
1 parent
c1ac4ddd
Exists in
staging
and in
42 other branches
ActionItem192: simplifying assert_sanitized method
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1702 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
test/test_helper.rb
| @@ -187,9 +187,9 @@ class Test::Unit::TestCase | @@ -187,9 +187,9 @@ class Test::Unit::TestCase | ||
| 187 | 187 | ||
| 188 | end | 188 | end |
| 189 | 189 | ||
| 190 | - # this check only if string has html tag | ||
| 191 | - def assert_sanitized(string) | ||
| 192 | - assert_no_match /<[^>]+\/?>/, string, "String #{string} expected to be sanitized" | 190 | + # this check only if text has html tag |
| 191 | + def assert_sanitized(text) | ||
| 192 | + assert !text.index('<'), "Text '#{text}' expected to be sanitized" | ||
| 193 | end | 193 | end |
| 194 | 194 | ||
| 195 | private | 195 | private |