Commit 001d3b42fc6907f35f8c9ffcc3c8c62a85316e5d
1 parent
3133eb48
Exists in
master
and in
22 other branches
spammer_log: not clean log on tests
Showing
3 changed files
with
0 additions
and
12 deletions
Show diff stats
test/unit/comment_test.rb
@@ -523,7 +523,6 @@ class CommentTest < ActiveSupport::TestCase | @@ -523,7 +523,6 @@ class CommentTest < ActiveSupport::TestCase | ||
523 | comment.spam! | 523 | comment.spam! |
524 | log = File.open('log/test_spammers.log') | 524 | log = File.open('log/test_spammers.log') |
525 | assert_match "Comment-id: #{comment.id} IP: 192.168.0.1", log.read | 525 | assert_match "Comment-id: #{comment.id} IP: 192.168.0.1", log.read |
526 | - SpammerLogger.clean_log | ||
527 | end | 526 | end |
528 | 527 | ||
529 | should 'not need moderation if article is not moderated' do | 528 | should 'not need moderation if article is not moderated' do |
test/unit/spammer_logger_test.rb
1 | require File.dirname(__FILE__) + '/../test_helper' | 1 | require File.dirname(__FILE__) + '/../test_helper' |
2 | 2 | ||
3 | class SpammerLoggerTest < ActiveSupport::TestCase | 3 | class SpammerLoggerTest < ActiveSupport::TestCase |
4 | - | ||
5 | - def setup | ||
6 | - SpammerLogger.reload_log | ||
7 | - end | ||
8 | - | ||
9 | - def teardown | ||
10 | - SpammerLogger.clean_log | ||
11 | - end | ||
12 | - | ||
13 | should 'log the spammer ip' do | 4 | should 'log the spammer ip' do |
14 | SpammerLogger.log('192.168.0.1') | 5 | SpammerLogger.log('192.168.0.1') |
15 | log = File.open('log/test_spammers.log') | 6 | log = File.open('log/test_spammers.log') |
@@ -22,5 +13,4 @@ class SpammerLoggerTest < ActiveSupport::TestCase | @@ -22,5 +13,4 @@ class SpammerLoggerTest < ActiveSupport::TestCase | ||
22 | log = File.open('log/test_spammers.log') | 13 | log = File.open('log/test_spammers.log') |
23 | assert_match "Comment-id: #{comment.id} IP: 192.168.0.1", log.read | 14 | assert_match "Comment-id: #{comment.id} IP: 192.168.0.1", log.read |
24 | end | 15 | end |
25 | - | ||
26 | end | 16 | end |
test/unit/suggest_article_test.rb
@@ -222,7 +222,6 @@ class SuggestArticleTest < ActiveSupport::TestCase | @@ -222,7 +222,6 @@ class SuggestArticleTest < ActiveSupport::TestCase | ||
222 | t.spam! | 222 | t.spam! |
223 | log = File.open('log/test_spammers.log') | 223 | log = File.open('log/test_spammers.log') |
224 | assert_match "SuggestArticle-id: #{t.id} IP: 192.168.0.1", log.read | 224 | assert_match "SuggestArticle-id: #{t.id} IP: 192.168.0.1", log.read |
225 | - SpammerLogger.clean_log | ||
226 | end | 225 | end |
227 | 226 | ||
228 | end | 227 | end |