Commit d5aef626d6310f73f4b837e00948432807b65bdd

Authored by Daniela Feitosa
1 parent 550663e9

Added attr created_by on copy when approve article

(ActionItem3097)
app/models/approve_article.rb
@@ -48,7 +48,7 @@ class ApproveArticle < Task @@ -48,7 +48,7 @@ class ApproveArticle < Task
48 end 48 end
49 49
50 def perform 50 def perform
51 - article.copy!(:name => name, :abstract => abstract, :body => body, :profile => target, :reference_article => article, :parent => article_parent, :highlighted => highlighted, :source => article.source, :last_changed_by_id => article.author_id) 51 + article.copy!(:name => name, :abstract => abstract, :body => body, :profile => target, :reference_article => article, :parent => article_parent, :highlighted => highlighted, :source => article.source, :last_changed_by_id => article.last_changed_by_id, :created_by_id => article.created_by_id)
52 end 52 end
53 53
54 def title 54 def title
test/unit/forum_helper_test.rb
@@ -38,7 +38,7 @@ class ForumHelperTest < ActiveSupport::TestCase @@ -38,7 +38,7 @@ class ForumHelperTest < ActiveSupport::TestCase
38 38
39 should 'return post update if it has no comments' do 39 should 'return post update if it has no comments' do
40 author = create_user('forum test author').person 40 author = create_user('forum test author').person
41 - some_post = create(TextileArticle, :name => 'First post', :profile => profile, :parent => forum, :published => true, :last_changed_by => author) 41 + some_post = create(TextileArticle, :name => 'First post', :profile => profile, :parent => forum, :published => true, :created_by => author)
42 assert some_post.comments.empty? 42 assert some_post.comments.empty?
43 out = last_topic_update(some_post) 43 out = last_topic_update(some_post)
44 assert_match some_post.updated_at.to_s, out 44 assert_match some_post.updated_at.to_s, out