mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
* Upgrade rubocop gem * Fix obsolete parameter * Fix Lint/MissingSuper * Fix Lint/ConstantDefinitionInBlock * Fix Layout/EmptyLineBetweenDefs * Add rubocop-minitest * Add rubocop-rake * Upgrade rubocop-performance
19 lines
347 B
Ruby
19 lines
347 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative 'spec_helper'
|
|
|
|
describe 'Rack::Attack' do
|
|
describe 'helpers' do
|
|
before do
|
|
Rack::Attack::Request.define_method :remote_ip do
|
|
ip
|
|
end
|
|
|
|
Rack::Attack.safelist('valid IP') do |req|
|
|
req.remote_ip == "127.0.0.1"
|
|
end
|
|
end
|
|
|
|
it_allows_ok_requests
|
|
end
|
|
end
|