summaryrefslogtreecommitdiff
path: root/spec/helpers/application_helper_spec.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2013-10-19 23:57:34 -0400
committerRobert Speicher <rspeicher@gmail.com>2013-10-19 23:57:34 -0400
commitbb494203d263104e9f2ac13d18c438798f7a99f8 (patch)
tree791d8143b81eddd91c111648fb9e67647f8024a7 /spec/helpers/application_helper_spec.rb
parent898e2acd33edbaa3eec689542150272f605330b1 (diff)
downloadgitlab-ce-bb494203d263104e9f2ac13d18c438798f7a99f8.tar.gz
Cover the simple_sanitize helper
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-rw-r--r--spec/helpers/application_helper_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb
index 0d066be5b45..d63a2de8806 100644
--- a/spec/helpers/application_helper_spec.rb
+++ b/spec/helpers/application_helper_spec.rb
@@ -123,4 +123,21 @@ describe ApplicationHelper do
end
end
+ describe "simple_sanitize" do
+ let(:a_tag) { '<a href="#">Foo</a>' }
+
+ it "allows the a tag" do
+ simple_sanitize(a_tag).should == a_tag
+ end
+
+ it "allows the span tag" do
+ input = '<span class="foo">Bar</span>'
+ simple_sanitize(input).should == input
+ end
+
+ it "disallows other tags" do
+ input = "<strike><b>#{a_tag}</b></strike>"
+ simple_sanitize(input).should == a_tag
+ end
+ end
end