diff --git a/test/unit/comment_test.rb b/test/unit/comment_test.rb index 14af13400..17cf09db9 100644 --- a/test/unit/comment_test.rb +++ b/test/unit/comment_test.rb @@ -243,6 +243,33 @@ class CommentTest < ActiveSupport::TestCase assert_equal([comment], post.comments.visible(user)) end end + + context "that is quoted" do + should "strip [quote] tags correctly" do + comment = FactoryGirl.create(:comment, body: <<-EOS.strip_heredoc) + paragraph one + + [quote] + somebody said: + + blah blah blah + [/QUOTE] + + paragraph two + EOS + + assert_equal(<<-EOS.strip_heredoc, comment.quoted_response) + [quote] + #{comment.creator_name} said: + + paragraph one + + paragraph two + [/quote] + + EOS + end + end end end end