Commit 4e5d8dd92d11f12d12975b018bc74e640ee4d3a5
Exists in
staging
and in
1 other branch
Merge branch 'staging' of softwarepublico.gov.br:noosferogov/noosfero into staging
Showing
2 changed files
with
2 additions
and
6 deletions
Show diff stats
app/models/approve_article.rb
@@ -9,9 +9,6 @@ class ApproveArticle < Task | @@ -9,9 +9,6 @@ class ApproveArticle < Task | ||
9 | if target.person? && requestor != target | 9 | if target.person? && requestor != target |
10 | self.errors.add(:requestor, _('You can not post articles to other users.')) | 10 | self.errors.add(:requestor, _('You can not post articles to other users.')) |
11 | end | 11 | end |
12 | - if target.organization? && !target.members.include?(requestor) && target.environment.portal_community != target | ||
13 | - self.errors.add(:requestor, _('Only members can post articles on communities.')) | ||
14 | - end | ||
15 | end | 12 | end |
16 | end | 13 | end |
17 | 14 |
test/unit/approve_article_test.rb
@@ -462,7 +462,7 @@ class ApproveArticleTest < ActiveSupport::TestCase | @@ -462,7 +462,7 @@ class ApproveArticleTest < ActiveSupport::TestCase | ||
462 | assert t2.invalid?(:requestor) | 462 | assert t2.invalid?(:requestor) |
463 | end | 463 | end |
464 | 464 | ||
465 | - should 'allow only members to be requestors when target is a community' do | 465 | + should 'allow anyone to be requestors when target is a community' do |
466 | community = fast_create(Community) | 466 | community = fast_create(Community) |
467 | member = fast_create(Person) | 467 | member = fast_create(Person) |
468 | community.add_member(member) | 468 | community.add_member(member) |
@@ -472,8 +472,7 @@ class ApproveArticleTest < ActiveSupport::TestCase | @@ -472,8 +472,7 @@ class ApproveArticleTest < ActiveSupport::TestCase | ||
472 | t2 = ApproveArticle.new(:requestor => non_member, :target => community) | 472 | t2 = ApproveArticle.new(:requestor => non_member, :target => community) |
473 | 473 | ||
474 | assert t1.valid? | 474 | assert t1.valid? |
475 | - assert !t2.valid? | ||
476 | - assert t2.invalid?(:requestor) | 475 | + assert t2.valid? |
477 | end | 476 | end |
478 | 477 | ||
479 | should 'allow any user to be requestor whe the target is the portal community' do | 478 | should 'allow any user to be requestor whe the target is the portal community' do |