Modified white ip form and created mailer

This commit is contained in:
Sergei Tsoganov 2023-07-05 15:28:43 +03:00
parent 311834c085
commit e00e44c9b8
10 changed files with 83 additions and 21 deletions

View file

@ -48,22 +48,6 @@ class ReppV1WhiteIpsCreateTest < ActionDispatch::IntegrationTest
assert json[:message].include? 'IP address limit exceeded'
end
def test_validates_ip_uniqueness_per_registrar
white_ip = white_ips(:one)
request_body = {
white_ip: {
address: white_ip.ipv4,
interfaces: ['API'],
},
}
post '/repp/v1/white_ips', headers: @auth_headers, params: request_body
json = JSON.parse(response.body, symbolize_names: true)
assert_response :bad_request
assert json[:message].include? 'IPv4 has already been taken'
end
def test_returns_error_response_if_throttled
ENV['shunter_default_threshold'] = '1'
ENV['shunter_enabled'] = 'true'