Commit cb8faa28 authored by Rodrigo Souto's avatar Rodrigo Souto

external-feed: add limit to title

parent 7ff6e3d5
......@@ -26,7 +26,7 @@ class ExternalFeed < ApplicationRecord
content = doc.to_s
article = TextArticle.new
article.name = title
article.name = title[0..149]
article.profile = blog.profile
article.body = content
article.published_at = date
......
......@@ -187,4 +187,12 @@ class ExternalFeedTest < ActiveSupport::TestCase
end
end
should 'limit feed title to ensure name size limit' do
blog = create_blog
e = build(:external_feed, :blog => blog, :feed_title => 'The Source')
assert_nothing_raised do
e.add_item('A'*180, 'http://orig.link.invalid', Time.now, '<p style="color: red">Html content 1.</p>')
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment