Merge pull request #483 from splitwise/rofreg/clean-up-documentation

Consolidate #testing section of README
This commit is contained in:
Gonzalo Rodriguez 2020-05-18 20:24:53 -03:00 committed by GitHub
commit d92f66c8d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,7 +40,6 @@ See the [Backing & Hacking blog post](https://www.kickstarter.com/backing-and-ha
- [Testing](#testing)
- [How it works](#how-it-works)
- [About Tracks](#about-tracks)
- [Testing](#testing)
- [Performance](#performance)
- [Motivation](#motivation)
- [Contributing](#contributing)
@ -396,6 +395,10 @@ end
## Testing
A note on developing and testing apps using Rack::Attack - if you are using throttling in particular, you will
need to enable the cache in your development environment. See [Caching with Rails](http://guides.rubyonrails.org/caching_with_rails.html)
for more on how to do this.
### Disabling
`Rack::Attack.enabled = false` can be used to either completely disable Rack::Attack in your tests, or to disable/enable for specific test cases only.
@ -441,13 +444,6 @@ can cleanly monkey patch helper methods onto the
`Rack::Attack.track` doesn't affect request processing. Tracks are an easy way to log and measure requests matching arbitrary attributes.
## Testing
A note on developing and testing apps using Rack::Attack - if you are using throttling in particular, you will
need to enable the cache in your development environment. See [Caching with Rails](http://guides.rubyonrails.org/caching_with_rails.html)
for more on how to do this.
## Performance
The overhead of running Rack::Attack is typically negligible (a few milliseconds per request),