mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
fixed tabs
This commit is contained in:
parent
486fceca9c
commit
569939e842
2 changed files with 70 additions and 70 deletions
|
@ -73,11 +73,11 @@ class AdminAreaAdminUsersIntegrationTest < JavaScriptApplicationSystemTestCase
|
||||||
fill_in 'Username', with: 'test_user_name'
|
fill_in 'Username', with: 'test_user_name'
|
||||||
# If valid=true creating valid user, if else, then with invalid data
|
# If valid=true creating valid user, if else, then with invalid data
|
||||||
if valid
|
if valid
|
||||||
fill_in 'Password', with: 'test_password'
|
fill_in 'Password', with: 'test_password'
|
||||||
fill_in 'Password confirmation', with: 'test_password'
|
fill_in 'Password confirmation', with: 'test_password'
|
||||||
else
|
else
|
||||||
fill_in 'Password', with: 'test_password'
|
fill_in 'Password', with: 'test_password'
|
||||||
fill_in 'Password confirmation', with: 'test_password2'
|
fill_in 'Password confirmation', with: 'test_password2'
|
||||||
end
|
end
|
||||||
fill_in 'Identity code', with: '38903110313'
|
fill_in 'Identity code', with: '38903110313'
|
||||||
fill_in 'Email', with: 'oleg@tester.ee'
|
fill_in 'Email', with: 'oleg@tester.ee'
|
||||||
|
@ -93,9 +93,9 @@ class AdminAreaAdminUsersIntegrationTest < JavaScriptApplicationSystemTestCase
|
||||||
click_on 'Save'
|
click_on 'Save'
|
||||||
|
|
||||||
if valid
|
if valid
|
||||||
assert_text 'Record created'
|
assert_text 'Record created'
|
||||||
else
|
else
|
||||||
assert_text 'Failed to create record'
|
assert_text 'Failed to create record'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,92 +3,92 @@ require 'application_system_test_case'
|
||||||
|
|
||||||
class AdminAreaWhiteIpsIntegrationTest < JavaScriptApplicationSystemTestCase
|
class AdminAreaWhiteIpsIntegrationTest < JavaScriptApplicationSystemTestCase
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
WebMock.allow_net_connect!
|
WebMock.allow_net_connect!
|
||||||
sign_in users(:admin)
|
sign_in users(:admin)
|
||||||
|
|
||||||
@registrar = registrars(:bestnames)
|
@registrar = registrars(:bestnames)
|
||||||
@white_ip = white_ips(:one)
|
@white_ip = white_ips(:one)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_visit_new_whitelisted_ip_page
|
def test_visit_new_whitelisted_ip_page
|
||||||
visit_new_whitelisted_ip_page
|
visit_new_whitelisted_ip_page
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_create_new_whitelisted_ip
|
def test_create_new_whitelisted_ip
|
||||||
visit_new_whitelisted_ip_page
|
visit_new_whitelisted_ip_page
|
||||||
fill_in 'IPv4', with: "127.0.0.1"
|
fill_in 'IPv4', with: "127.0.0.1"
|
||||||
fill_in 'IPv6', with: "::ffff:192.0.2.1"
|
fill_in 'IPv6', with: "::ffff:192.0.2.1"
|
||||||
|
|
||||||
find(:css, "#white_ip_interfaces_api").set(true)
|
find(:css, "#white_ip_interfaces_api").set(true)
|
||||||
find(:css, "#white_ip_interfaces_registrar").set(true)
|
find(:css, "#white_ip_interfaces_registrar").set(true)
|
||||||
|
|
||||||
click_on 'Save'
|
click_on 'Save'
|
||||||
|
|
||||||
assert_text 'Record created'
|
assert_text 'Record created'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_failed_to_create_new_whitelisted_ip
|
def test_failed_to_create_new_whitelisted_ip
|
||||||
visit_new_whitelisted_ip_page
|
visit_new_whitelisted_ip_page
|
||||||
fill_in 'IPv4', with: "asdadadad.asd"
|
fill_in 'IPv4', with: "asdadadad.asd"
|
||||||
|
|
||||||
click_on 'Save'
|
click_on 'Save'
|
||||||
|
|
||||||
assert_text 'Failed to create record'
|
assert_text 'Failed to create record'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_visit_edit_whitelisted_ip_page
|
def test_visit_edit_whitelisted_ip_page
|
||||||
visit_edit_whitelisted_ip_page
|
visit_edit_whitelisted_ip_page
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_update_whitelisted_ip
|
def test_update_whitelisted_ip
|
||||||
visit_info_whitelisted_ip_page
|
visit_info_whitelisted_ip_page
|
||||||
click_on 'Edit'
|
click_on 'Edit'
|
||||||
|
|
||||||
fill_in 'IPv4', with: "127.0.0.2"
|
fill_in 'IPv4', with: "127.0.0.2"
|
||||||
find(:css, "#white_ip_interfaces_api").set(false)
|
find(:css, "#white_ip_interfaces_api").set(false)
|
||||||
click_on 'Save'
|
click_on 'Save'
|
||||||
|
|
||||||
assert_text 'Record updated'
|
assert_text 'Record updated'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_failed_to_update_whitelisted_ip
|
def test_failed_to_update_whitelisted_ip
|
||||||
visit_info_whitelisted_ip_page
|
visit_info_whitelisted_ip_page
|
||||||
click_on 'Edit'
|
click_on 'Edit'
|
||||||
fill_in 'IPv4', with: "asdadad#"
|
fill_in 'IPv4', with: "asdadad#"
|
||||||
|
|
||||||
click_on 'Save'
|
click_on 'Save'
|
||||||
|
|
||||||
assert_text 'Failed to update record'
|
assert_text 'Failed to update record'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_visit_info_whitelisted_ip_page
|
def test_visit_info_whitelisted_ip_page
|
||||||
visit_info_whitelisted_ip_page
|
visit_info_whitelisted_ip_page
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_delete_whitelisted_ip
|
def test_delete_whitelisted_ip
|
||||||
visit_info_whitelisted_ip_page
|
visit_info_whitelisted_ip_page
|
||||||
click_on 'Delete'
|
click_on 'Delete'
|
||||||
|
|
||||||
page.driver.browser.switch_to.alert.accept
|
page.driver.browser.switch_to.alert.accept
|
||||||
|
|
||||||
assert_text 'Record deleted'
|
assert_text 'Record deleted'
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def visit_new_whitelisted_ip_page
|
def visit_new_whitelisted_ip_page
|
||||||
visit new_admin_registrar_white_ip_path(registrar_id: @registrar.id)
|
visit new_admin_registrar_white_ip_path(registrar_id: @registrar.id)
|
||||||
assert_text 'New whitelisted IP'
|
assert_text 'New whitelisted IP'
|
||||||
end
|
end
|
||||||
|
|
||||||
def visit_edit_whitelisted_ip_page
|
def visit_edit_whitelisted_ip_page
|
||||||
visit edit_admin_registrar_white_ip_path(registrar_id: @registrar.id, id: @white_ip.id)
|
visit edit_admin_registrar_white_ip_path(registrar_id: @registrar.id, id: @white_ip.id)
|
||||||
assert_text 'Edit white IP'
|
assert_text 'Edit white IP'
|
||||||
end
|
end
|
||||||
|
|
||||||
def visit_info_whitelisted_ip_page
|
def visit_info_whitelisted_ip_page
|
||||||
visit admin_registrar_white_ip_path(registrar_id: @registrar.id, id: @white_ip.id)
|
visit admin_registrar_white_ip_path(registrar_id: @registrar.id, id: @white_ip.id)
|
||||||
assert_text 'White IP'
|
assert_text 'White IP'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue