Commit e960f24dd9e0a3191f3158e02c53f99d9528714b
1 parent
c7c87796
Exists in
master
and in
28 other branches
[postgres-tests] Fixing recent documents block tests
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
test/unit/recent_documents_block_test.rb
| @@ -4,6 +4,7 @@ class RecentDocumentsBlockTest < ActiveSupport::TestCase | @@ -4,6 +4,7 @@ class RecentDocumentsBlockTest < ActiveSupport::TestCase | ||
| 4 | 4 | ||
| 5 | def setup | 5 | def setup |
| 6 | @profile = create_user('testinguser').person | 6 | @profile = create_user('testinguser').person |
| 7 | + @profile.articles.destroy_all | ||
| 7 | ['first', 'second', 'third', 'fourth', 'fifth'].each do |name| | 8 | ['first', 'second', 'third', 'fourth', 'fifth'].each do |name| |
| 8 | @profile.articles << TextArticle.create(:name => name) | 9 | @profile.articles << TextArticle.create(:name => name) |
| 9 | end | 10 | end |
| @@ -24,7 +25,7 @@ class RecentDocumentsBlockTest < ActiveSupport::TestCase | @@ -24,7 +25,7 @@ class RecentDocumentsBlockTest < ActiveSupport::TestCase | ||
| 24 | 25 | ||
| 25 | should 'output list with links to recent documents' do | 26 | should 'output list with links to recent documents' do |
| 26 | output = block.content | 27 | output = block.content |
| 27 | - | 28 | + |
| 28 | assert_match /href=.*\/testinguser\/first/, output | 29 | assert_match /href=.*\/testinguser\/first/, output |
| 29 | assert_match /href=.*\/testinguser\/second/, output | 30 | assert_match /href=.*\/testinguser\/second/, output |
| 30 | assert_match /href=.*\/testinguser\/third/, output | 31 | assert_match /href=.*\/testinguser\/third/, output |