mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 05:26:17 +02:00
Add admin mailers and tests to white_ips
This commit is contained in:
parent
149cbb6138
commit
f68d8e91c2
8 changed files with 45 additions and 6 deletions
|
@ -16,7 +16,7 @@ class ReppV1ApiWhiteIpsUpdateTest < ActionDispatch::IntegrationTest
|
|||
def test_updates_white_ip
|
||||
request_body = {
|
||||
white_ip: {
|
||||
address: '127.0.0.1',
|
||||
address: '127.0.0.2',
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,11 @@ class ReppV1ApiWhiteIpsUpdateTest < ActionDispatch::IntegrationTest
|
|||
assert_equal 'Command completed successfully', json[:message]
|
||||
|
||||
ip = WhiteIp.find(json[:data][:ip][:id])
|
||||
assert_equal ip.ipv4, @white_ip.ipv4
|
||||
assert_equal ip.ipv4, '127.0.0.2'
|
||||
refute ip.committed
|
||||
|
||||
last_email = ActionMailer::Base.deliveries.last
|
||||
assert last_email.subject.include?('Whitelisted IP Address Change Notification')
|
||||
end
|
||||
|
||||
def test_returns_error_if_ipv4_wrong_format
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue