Skip to content

Commit

Permalink
updated snookery and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rsl committed Apr 6, 2008
1 parent 4a90a67 commit 382a9f0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
11 changes: 7 additions & 4 deletions lib/lucky_sneaks/acts_as_snook.rb
Expand Up @@ -19,8 +19,8 @@ def acts_as_snook(options = {})
-online 4u 4-u acne adipex advicer baccarrat blackjack bllogspot booker buy byob carisoprodol
casino chatroom cialis coolhu credit-card-debt cwas cyclen cyclobenzaprine
day-trading debt-consolidation discreetordering duty-free dutyfree equityloans fioricet
freenet gambling- hair-loss homefinance holdem incest jrcreations leethal levitra macinstruct
mortgagequotes online-gambling ottawavalleyag ownsthis paxil penis pharmacy phentermine
freenet free\s*shipping gambling- hair-loss homefinance holdem incest jrcreations leethal levitra macinstruct
mortgagequotes nemogs online-gambling ottawavalleyag ownsthis paxil penis pharmacy phentermine
poker poze pussy ringtones roulette shemale shoes -site slot-machine thorcarlson
tramadol trim-spa ultram valeofglamorganconservatives viagra vioxx xanax zolus
}
Expand Down Expand Up @@ -105,8 +105,11 @@ def calculate_snook_for_previous_comments

def calculate_snook_for_spam_words
spam_words.each do |word|
deduct_snook_credits(1) if snook_body =~ /#{word}/i
deduct_snook_credits(1) if snook_url =~ /#{word}/i
regex = /#{word}/i
deduct_snook_credits(1) if snook_author =~ regex
deduct_snook_credits(1) if snook_email =~ regex
deduct_snook_credits(1) if snook_body =~ regex
deduct_snook_credits(1) if snook_url =~ regex
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/acts_as_snook_interface_test.rb
Expand Up @@ -3,10 +3,10 @@
class ActsAsSnookInterfaceTest < Test::Unit::TestCase
def test_marks_spam_as_spam
SPAM_COMMENTS.each do |comment_attributes|
@comment = Comment.new(comment_attributes)
@comment.valid?
@comment = Comment.create(comment_attributes)
assert_equal "spam", @comment.spam_status
end
Comment.destroy_all
end

def test_marks_ham_as_ham
Expand Down
15 changes: 15 additions & 0 deletions test/test_helper.rb
Expand Up @@ -105,6 +105,21 @@ def setup_prior_comments
[URL=http://www.nemogs.com/r/]They are having a huge sale right now, check out the site for all the info.[/URL]
[URL=http://www.nemogs.com/r/]Everybody I know has got a couple bottles of this stuff, it simply works! Don't be the only one left behind![/URL]
Product here - http://nemogs.com/r/index.php}
},
{
:author => "Tweerasiaro",
:email => "iledygoro@yandex.ru",
:url => "http://www.nemogs.com",
:body => %q{Hey bro, nice talking to you the other day.
Thought you would want to check this out, I got some for myself cause they were on sale, you should check out the site, I added the link below.
Steel Package: 10 Patches reg $79.95 Now $49.95! Free shipping too!
Silver Package: 25 Patches reg $129.95, Now $99.95! Free shipping and free exercise manual included!
Gold Package: 40 Patches reg $189.95, Now $149.95! Free shipping and free exercise manual included!
Platinum Package: 65 Patches reg $259.95, Now $199.95! Free shipping and free exercise manual included! (Best Value!)
I know like 10 guys who have already stocked up on these.
[URL=http://www.nemogs.com]Here's the link to check out bro![/URL]
Talk to you soon!
Product here - http://www.nemogs.com}
}
]

Expand Down

0 comments on commit 382a9f0

Please sign in to comment.