[Git][noosfero/noosfero][master] 2 commits: link-article: reference author from source article

Rodrigo Souto gitlab at mg.gitlab.com
Fri Mar 9 10:58:39 BRT 2018


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
b5f6b23d by Rodrigo Souto at 2018-03-09T13:27:30Z
link-article: reference author from source article

- - - - -
b11d37bf by Rodrigo Souto at 2018-03-09T13:58:29Z
Merge branch 'link-article-author' into 'master'

link-article: reference author from source article

See merge request noosfero/noosfero!1414
- - - - -


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/compare/599c46accb92fa8edcea4b22b3f0a3baf19b348b...b11d37bf8e997202d496e0961d3b567511e74623

---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/599c46accb92fa8edcea4b22b3f0a3baf19b348b...b11d37bf8e997202d496e0961d3b567511e74623
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/d6688cb5/attachment-0001.html>


More information about the Noosfero-dev mailing list