mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
21 lines
361 B
Ruby
21 lines
361 B
Ruby
# frozen_string_literal: true
|
|
|
|
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
|
|
|
|
it_allows_ok_requests
|
|
end
|
|
end
|