mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
19 lines
326 B
Ruby
19 lines
326 B
Ruby
require_relative 'spec_helper'
|
|
|
|
describe 'Rack::Attack' do
|
|
describe 'helpers' do
|
|
before do
|
|
class Rack::Attack::Request
|
|
def remote_ip
|
|
ip
|
|
end
|
|
end
|
|
|
|
Rack::Attack.safelist('valid IP') do |req|
|
|
req.remote_ip == "127.0.0.1"
|
|
end
|
|
end
|
|
|
|
allow_ok_requests
|
|
end
|
|
end
|