Commit 8b1805dce3adbaf8a95dd7355a797aca38e15d41

Authored by André Guedes
Committed by Arthur Esposte
1 parent fac42cd6
Exists in tests_fixies and in 1 other branch tests

Fix tests related to privacity

Signed-off-by: André Guedes <andrebsguedes@gmail.com>
Signed-off-by: Arthur Del Esposte <arthurmde@gmail.com>
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Tallys Martins <tallysmartins@yahoo.com.br>
app/models/article.rb
... ... @@ -28,7 +28,7 @@ class Article &lt; ActiveRecord::Base
28 28 def initialize(*params)
29 29 super
30 30  
31   - if !params.blank? && params.first.has_key?(:profile)
  31 + if !params.blank? && params.first.has_key?(:profile) && !params.first[:profile].blank?
32 32 profile = params.first[:profile]
33 33 self.published = false unless profile.public?
34 34 end
... ...
test/functional/content_viewer_controller_test.rb
... ... @@ -1527,12 +1527,12 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
1527 1527 should 'use context method in extra toolbar actions on article from plugins' do
1528 1528 class Plugin1 < Noosfero::Plugin
1529 1529 def article_extra_toolbar_buttons(article)
1530   - if current_person.public?
  1530 + if profile.public?
1531 1531 {:title => 'some_title', :icon => 'some_icon', :url => '/someurl'}
1532 1532 else
1533 1533 {:title => 'another_title', :icon => 'another_icon', :url => '/anotherurl'}
1534 1534 end
1535   - end
  1535 + end
1536 1536 end
1537 1537 Noosfero::Plugin.stubs(:all).returns([Plugin1.name])
1538 1538  
... ...
test/functional/organizations_controller_test.rb
... ... @@ -86,7 +86,7 @@ class OrganizationsControllerTest &lt; ActionController::TestCase
86 86  
87 87 should 'activate organization profile' do
88 88 organization = fast_create(Organization, :visible => false, :environment_id => environment.id)
89   - assert organization.disabled?
  89 + assert !organization.visible?
90 90  
91 91 get :activate, {:id => organization.id}
92 92 organization.reload
... ...