From fc87be858c7037046e69972d1987a55cabb2c165 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Fri, 29 Feb 2008 19:42:04 +0000 Subject: [PATCH] ActionItem193: tested the exclusion of non text arguments of the recent documents list --- test/unit/recent_documents_block_test.rb | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/test/unit/recent_documents_block_test.rb b/test/unit/recent_documents_block_test.rb index 06c2f6f..e94a089 100644 --- a/test/unit/recent_documents_block_test.rb +++ b/test/unit/recent_documents_block_test.rb @@ -3,18 +3,16 @@ require File.dirname(__FILE__) + '/../test_helper' class RecentDocumentsBlockTest < Test::Unit::TestCase def setup - profile = create_user('testinguser').person - profile.articles.build(:name => 'first').save! - profile.articles.build(:name => 'second').save! - profile.articles.build(:name => 'third').save! - profile.articles.build(:name => 'fourth').save! - profile.articles.build(:name => 'fifth').save! + @profile = create_user('testinguser').person + ['first', 'second', 'third', 'fourth', 'fifth'].each do |name| + @profile.articles << TextArticle.create(:name => name) + end box = Box.create!(:owner => profile) @block = RecentDocumentsBlock.create!(:box_id => box.id) end - attr_reader :block + attr_reader :block, :profile should 'describe itself' do assert_not_equal Block.description, RecentDocumentsBlock.description @@ -42,4 +40,14 @@ class RecentDocumentsBlockTest < Test::Unit::TestCase assert_no_match /href=.*\/testinguser\/first/, output end + should 'not list rss feed articles' do + profile.articles << RssFeed.create(:name => 'sixth') + profile.save! + + output = block.content + + assert_match /href=.*\/testinguser\/first/, output + assert_no_match /href=.*\/testinguser\/sixth/, output + end + end -- libgit2 0.21.2