Merge pull request #2998 from evazion/fix-quote-stripping

Fix [quote] stripping for comments, forum post replies.
This commit is contained in:
Albert Yi
2017-04-26 12:43:30 -07:00
committed by GitHub
7 changed files with 50 additions and 46 deletions

View File

@@ -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