tests: fix test failures when running without API keys.
Fix the test suite failing when trying to run it in the default state with no config file or API keys configured. Most source sites require API keys or login credentials to be set in order to work. Skip these tests when credentials aren't configured.
This commit is contained in:
@@ -14,10 +14,11 @@ class DmailTest < ActiveSupport::TestCase
|
||||
|
||||
context "that is spam" do
|
||||
should "be automatically reported and deleted" do
|
||||
skip "Rakismet credentials not configured" unless SpamDetector.enabled?
|
||||
|
||||
@recipient = create(:user)
|
||||
@spammer = create(:user, created_at: 2.weeks.ago, email_address: build(:email_address, address: "akismet-guaranteed-spam@example.com"))
|
||||
|
||||
SpamDetector.stubs(:enabled?).returns(true)
|
||||
dmail = create(:dmail, owner: @recipient, from: @spammer, to: @recipient, creator_ip_addr: "127.0.0.1")
|
||||
|
||||
assert_equal(1, dmail.moderation_reports.count)
|
||||
|
||||
Reference in New Issue
Block a user