README.md in rakismet-1.2.1 vs README.md in rakismet-1.3.0

- old
+ new

@@ -18,17 +18,24 @@ Once you've installed the Rakismet gem and added it to your application's Gemfile, you'll need an API key. Head on over to http://akismet.com/signup/ and sign up for a new username. Configure the Rakismet key and the URL of your application by setting the following -in an initializer or application.rb: +in application.rb: ```ruby config.rakismet.key = 'your wordpress key' config.rakismet.url = 'http://yourdomain.com/' ``` - + +or an initializer, for example `config/initializers/rakismet.rb`: + +```ruby +YourApp::Application.config.rakismet.key = 'your wordpress key' +YourApp::Application.config.rakismet.url = 'http://yourdomain.com/' +``` + If you wish to use another Akismet-compatible API provider such as TypePad's antispam service, you'll also need to set `config.rakismet.host` to your service provider's endpoint. If you want to use a proxy to access akismet (i.e. your application is behind a @@ -134,9 +141,36 @@ your app initialization: ```ruby config.rakismet.use_middleware = false ``` + +Testing +------- + +Rakismet can be configued to tell Akismet that it should operate in test mode - +so Akismet will not change its behavior based on any test API calls, meaning +they will have no training effect. That means your tests can be somewhat +repeatable in the sense that one test won't influence subsequent calls. + +You can configure Rakismet for test mode via application.rb: + +```ruby +config.rakismet.test = false # <- default +config.rakismet.test = true +``` + +Or via an initializer: + +```ruby +YourApp::Application.config.rakismet.test = false # <- default +YourApp::Application.config.rakismet.test = true +``` + +**NOTE**: When running in Rails, Rakismet will run in test mode when your Rails +environment is `test` or `development`, unless explictly configured otherwise. +Outside of Rails Rakismet defaults to test mode turned **off**. + Verifying Responses ------------------- If you want to see what's happening behind the scenes, after you call one of