diff --git a/app/views/profile/_create_article.html.erb b/app/views/profile/_create_article.html.erb index a4cdc1f..fcb2ce2 100644 --- a/app/views/profile/_create_article.html.erb +++ b/app/views/profile/_create_article.html.erb @@ -9,7 +9,7 @@
<%= time_ago_in_words(activity.created_at) %>
diff --git a/test/integration/safe_strings_test.rb b/test/integration/safe_strings_test.rb index 5e8b97d..3c5c4de 100644 --- a/test/integration/safe_strings_test.rb +++ b/test/integration/safe_strings_test.rb @@ -117,4 +117,22 @@ class SafeStringsTest < ActionDispatch::IntegrationTest get "/myprofile/jimi/cms/new?type=TinyMceArticle" assert_no_match /title: "Safestringstest::plugin1::macro"/, response.body end + + should 'not escape short_description of articles in activities' do + user = create_user('marley', :password => 'test', :password_confirmation => 'test') + user.activate + profile = user.person + login 'marley', 'test' + + expected_content = 'something' + html_content = "#{expected_content}
" + article = TinyMceArticle.create!(:profile => profile, :name => 'An Article about Free Software', :body => html_content) + ActionTracker::Record.destroy_all + activity = create(ActionTracker::Record, :user_id => profile.id, :user_type => 'Profile', :verb => 'create_article', :target_id => article.id, :target_type => 'Article', :params => {'name' => article.name, 'url' => article.url, 'lead' => article.lead, 'first_image' => article.first_image}) + get "/profile/marley" + assert_tag 'li', :attributes => {:id => "profile-activity-item-#{activity.id}"}, :descendant => { + :tag => 'div', :content => "\n " + expected_content, :attributes => {:class => 'profile-activity-lead'} + } + end + end -- libgit2 0.21.2