Commit 6058722d735f154f65423f2fb78cfeb0f944f20d

Authored by MoisesMachado
1 parent 4d39d7f9

ActionItem616: fixed listing of recent private content

git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2400 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/article.rb
@@ -77,7 +77,7 @@ class Article < ActiveRecord::Base @@ -77,7 +77,7 @@ class Article < ActiveRecord::Base
77 # 77 #
78 # Only includes articles where advertise == true 78 # Only includes articles where advertise == true
79 def self.recent(limit) 79 def self.recent(limit)
80 - options = { :limit => limit, :conditions => { :advertise => true }, :order => 'created_at desc, articles.id desc' } 80 + options = { :limit => limit, :conditions => { :advertise => true, :public_article => true }, :order => 'created_at desc, articles.id desc' }
81 self.find(:all, options) 81 self.find(:all, options)
82 end 82 end
83 83
test/functional/profile_editor_controller_test.rb
@@ -213,21 +213,6 @@ class ProfileEditorControllerTest < Test::Unit::TestCase @@ -213,21 +213,6 @@ class ProfileEditorControllerTest < Test::Unit::TestCase
213 assert_equal false, Profile['ze'].public_profile 213 assert_equal false, Profile['ze'].public_profile
214 end 214 end
215 215
216 - should 'display public_content field for editing' do  
217 - profile = Profile['ze']  
218 - get :edit, :profile => 'ze'  
219 - assert_tag :tag => 'input', :attributes => { :type => 'radio', :checked => 'checked', :name => 'profile_data[public_content]', :value => 'true' }  
220 - assert_tag :tag => 'input', :attributes => { :type => 'radio', :name => 'profile_data[public_content]', :value => 'false' }  
221 - end  
222 -  
223 - should 'display properly that the content is non-public' do  
224 - profile = Profile['ze']  
225 - profile.update_attributes(:public_content => false)  
226 - get :edit, :profile => 'ze'  
227 - assert_tag :tag => 'input', :attributes => { :type => 'radio', :checked => 'checked', :name => 'profile_data[public_content]', :value => 'false' }  
228 - assert_tag :tag => 'input', :attributes => { :type => 'radio', :name => 'profile_data[public_content]', :value => 'true' }  
229 - end  
230 -  
231 should 'show error messages for invalid foundation_year' do 216 should 'show error messages for invalid foundation_year' do
232 org = Organization.create!(:name => 'test org', :identifier => 'testorg') 217 org = Organization.create!(:name => 'test org', :identifier => 'testorg')
233 post :edit, :profile => 'testorg', :profile_data => { :foundation_year => 'aaa' } 218 post :edit, :profile => 'testorg', :profile_data => { :foundation_year => 'aaa' }