[Git][noosfero/noosfero][stable-1.10] Merge branch 'link-article-author' into 'master'

Rodrigo Souto gitlab at mg.gitlab.com
Fri Mar 9 10:59:05 BRT 2018


Rodrigo Souto pushed to branch stable-1.10 at Noosfero / noosfero


Commits:
99603b4e by Rodrigo Souto at 2018-03-09T13:58:50Z
Merge branch 'link-article-author' into 'master'

link-article: reference author from source article

See merge request noosfero/noosfero!1414

(cherry picked from commit b11d37bf8e997202d496e0961d3b567511e74623)

b5f6b23d link-article: reference author from source article
- - - - -


2 changed files:

- app/models/link_article.rb
- test/unit/link_article_test.rb


Changes:

=====================================
app/models/link_article.rb
=====================================
--- a/app/models/link_article.rb
+++ b/app/models/link_article.rb
@@ -10,5 +10,6 @@ class LinkArticle < Article
   delegate :body, :to => :reference_article
   delegate :abstract, :to => :reference_article
   delegate :url, :to => :reference_article
+  delegate :author, :to => :reference_article
 
 end


=====================================
test/unit/link_article_test.rb
=====================================
--- a/test/unit/link_article_test.rb
+++ b/test/unit/link_article_test.rb
@@ -19,6 +19,13 @@ class LinkArticleTest < ActiveSupport::TestCase
     assert_equal article.name, link.name
   end
 
+  should 'author of article link is the same as the name of referenced article' do
+    author = fast_create(Person)
+    article = fast_create(Article, :profile_id => profile.id, :author_id => author.id)
+    link = LinkArticle.new(:reference_article => article)
+    assert_equal article.author, link.author
+  end
+
   should 'destroy link article when reference article is removed' do
     target_profile = fast_create(Community)
     article = fast_create(Article, :profile_id => profile.id)



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/99603b4e39196b286ee9362c009441a6ab27a6f1

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/99603b4e39196b286ee9362c009441a6ab27a6f1
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180309/8421aac7/attachment.html>


More information about the Noosfero-dev mailing list