diff --git a/app/models/article.rb b/app/models/article.rb index 83658a4..df48c6b 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -98,7 +98,7 @@ class Article < ActiveRecord::Base public_article = ? AND published = ? AND profiles.public_profile = ? AND - (articles.type != ? OR articles.type is NULL)", true, true, true, true, 'UploadedFile' + ((articles.type != ? and articles.type != ?) OR articles.type is NULL)", true, true, true, true, 'UploadedFile', 'RssFeed' ], :include => 'profile', :order => 'articles.updated_at desc, articles.id desc' diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index c3a6b4c..c59f5d6 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -154,14 +154,6 @@ class ProfileControllerTest < Test::Unit::TestCase assert_tag :tag => 'div', :content => 'Recent content', :attributes => { :class => 'block recent-documents-block' }, :child => { :tag => 'ul', :content => /#{person.home_page.name}/ } end - should 'show feed on recent content after update' do - person = create_user('person_1').person - person.articles.find_by_path('feed').name = 'Changed name' - assert person.articles.find_by_path('feed').save! - get :index, :profile => person.identifier - assert_tag :tag => 'div', :content => 'Recent content', :attributes => { :class => 'block recent-documents-block' }, :child => { :tag => 'ul', :content => /#{person.articles.find_by_path('feed').name}/ } - end - should 'display tag for profile' do @profile.articles.create!(:name => 'testarticle', :tag_list => 'tag1') diff --git a/test/unit/article_test.rb b/test/unit/article_test.rb index e65af2c..fc4e84c 100644 --- a/test/unit/article_test.rb +++ b/test/unit/article_test.rb @@ -207,6 +207,16 @@ class ArticleTest < Test::Unit::TestCase assert_equal [ second ], Article.recent(nil) end + should 'not show RssFeed as recent' do + p = create_user('usr1').person + Article.destroy_all + first = RssFeed.create!(:profile => p, :name => 'my feed', :advertise => true) + first.limit = 10; first.save! + second = p.articles.build(:name => 'second'); second.save! + + assert_equal [ second ], Article.recent(nil) + end + should 'require that subclasses define description' do assert_raise NotImplementedError do Article.description diff --git a/test/unit/recent_documents_block_test.rb b/test/unit/recent_documents_block_test.rb index e12971f..183b1df 100644 --- a/test/unit/recent_documents_block_test.rb +++ b/test/unit/recent_documents_block_test.rb @@ -44,21 +44,6 @@ class RecentDocumentsBlockTest < Test::Unit::TestCase assert_no_match /href=.*\/testinguser\/first/, output end - should 'not list rss feed articles automatically created' do - assert_equal 'feed', profile.articles.find_by_path('feed').name - output = block.content - assert_match /href=.*\/testinguser\/first/, output - assert_no_match /href=.*\/testinguser\/feed/, output - end - - should 'list rss feed articles after update' do - profile.articles.find_by_path('feed').name = 'chaged name' - assert profile.articles.find_by_path('feed').save! - output = block.content - assert_match /href=.*\/testinguser\/first/, output - assert_match /href=.*\/testinguser\/feed/, output - end - should 'display a link to sitemap with title "All content"' do expects(:link_to).with('All content', :controller => 'profile', :action => 'sitemap', :profile => profile.identifier) expects(:_).with('All content').returns('All content') -- libgit2 0.21.2