mirror of
https://github.com/internetee/registry.git
synced 2025-07-30 14:36:22 +02:00
Remove registrar portal tests
This commit is contained in:
parent
e8f2360c36
commit
70d8c5bad3
29 changed files with 0 additions and 1541 deletions
|
@ -1,44 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAccountActivitiesTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@registrar = registrars(:bestnames)
|
||||
sign_in users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_show_account_activity_page
|
||||
account_activities(:one).update(sum: "123.00")
|
||||
visit registrar_account_activities_path
|
||||
assert_text 'Account activity'
|
||||
end
|
||||
|
||||
def test_download_account_activity
|
||||
now = Time.zone.parse('2010-07-05 08:00')
|
||||
travel_to now
|
||||
account_activities(:one).update(sum: "123.00")
|
||||
|
||||
get registrar_account_activities_path(format: :csv)
|
||||
|
||||
assert_response :ok
|
||||
assert_equal "text/csv", response.headers['Content-Type']
|
||||
assert_equal %(attachment; filename="account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv"; filename*=UTF-8''account_activities_#{Time.zone.now.to_formatted_s(:number)}.csv),
|
||||
response.headers['Content-Disposition']
|
||||
assert_not_empty response.body
|
||||
end
|
||||
|
||||
def test_search_account_activity_with_invalid_date
|
||||
account_activities(:one).update(description: "Description of activity one",
|
||||
sum: "123.00",
|
||||
activity_type: "create",
|
||||
created_at: Time.zone.parse('2021-07-05 10:00'))
|
||||
|
||||
visit registrar_account_activities_path
|
||||
|
||||
find('#q_activity_type_in').click
|
||||
find(:option, "Renew").select_option
|
||||
fill_in('q_created_at_lteq', with: '2021-12--')
|
||||
find(:xpath, ".//button[./span[contains(@class, 'glyphicon-search')]]").click
|
||||
|
||||
assert_text 'Description of activity renew_cash'
|
||||
end
|
||||
end
|
|
@ -1,26 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAccountTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@registrar = registrars(:bestnames)
|
||||
sign_in users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_updates_account
|
||||
new_billing_email = 'new@registrar.test'
|
||||
new_iban = 'GB77BARC20201530093459'
|
||||
assert_not_equal new_billing_email, @registrar.billing_email
|
||||
assert_not_equal new_iban, @registrar.iban
|
||||
|
||||
visit registrar_account_path
|
||||
click_on 'Edit'
|
||||
|
||||
fill_in 'Billing email', with: new_billing_email
|
||||
fill_in 'IBAN', with: new_iban
|
||||
click_on 'Save changes'
|
||||
|
||||
assert_text 'Your account has been updated'
|
||||
assert_text new_billing_email
|
||||
assert_text new_iban
|
||||
end
|
||||
end
|
|
@ -1,12 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class AddDepositsTest < ApplicationSystemTestCase
|
||||
include ActionMailer::TestHelper
|
||||
|
||||
setup do
|
||||
sign_in users(:api_bestnames)
|
||||
@invoice = invoices(:one)
|
||||
|
||||
ActionMailer::Base.deliveries.clear
|
||||
end
|
||||
end
|
|
@ -1,51 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaBaseTestTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@original_registrar_area_ip_whitelist = Setting.registrar_ip_whitelist_enabled
|
||||
end
|
||||
|
||||
teardown do
|
||||
Setting.registrar_ip_whitelist_enabled = @original_registrar_area_ip_whitelist
|
||||
end
|
||||
|
||||
def test_user_cannot_access_without_ip_address_being_whitelisted
|
||||
Setting.registrar_ip_whitelist_enabled = true
|
||||
WhiteIp.delete_all
|
||||
|
||||
visit new_registrar_user_session_url
|
||||
|
||||
assert_text 'Access denied from IP 127.0.0.1'
|
||||
assert_no_button 'Login'
|
||||
end
|
||||
|
||||
def test_user_can_access_when_ip_is_whitelisted
|
||||
white_ips(:one).update!(ipv4: '127.0.0.1', interfaces: [WhiteIp::REGISTRAR])
|
||||
Setting.registrar_ip_whitelist_enabled = true
|
||||
|
||||
visit new_registrar_user_session_url
|
||||
|
||||
assert_no_text 'Access denied from IP 127.0.0.1'
|
||||
assert_button 'Login'
|
||||
end
|
||||
|
||||
def test_user_can_access_when_ip_is_whitelisted_with_subnet
|
||||
white_ips(:one).update!(ipv4: '127.0.0.1/32', interfaces: [WhiteIp::REGISTRAR])
|
||||
Setting.registrar_ip_whitelist_enabled = true
|
||||
|
||||
visit new_registrar_user_session_url
|
||||
|
||||
assert_no_text 'Access denied from IP 127.0.0.1'
|
||||
assert_button 'Login'
|
||||
end
|
||||
|
||||
def test_user_can_access_when_ip_is_not_whitelisted_and_whitelist_is_disabled
|
||||
Setting.registrar_ip_whitelist_enabled = false
|
||||
WhiteIp.delete_all
|
||||
|
||||
visit new_registrar_user_session_url
|
||||
|
||||
assert_no_text 'Access denied from IP 127.0.0.1'
|
||||
assert_button 'Login'
|
||||
end
|
||||
end
|
|
@ -1,46 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class BalanceTopUpTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:api_bestnames)
|
||||
@original_registry_vat_rate = Setting.registry_vat_prc
|
||||
|
||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
||||
Spy.on_instance_method(EisBilling::AddDeposits, :send_invoice).and_return(eis_response)
|
||||
Spy.on_instance_method(EisBilling::BaseController, :authorized).and_return(true)
|
||||
end
|
||||
|
||||
teardown do
|
||||
Setting.registry_vat_prc = @original_registry_vat_rate
|
||||
end
|
||||
|
||||
def test_creates_new_invoice
|
||||
if Feature.billing_system_integrated?
|
||||
invoice_n = Invoice.order(number: :desc).last.number
|
||||
stub_request(:post, "https://eis_billing_system:3000/api/v1/invoice_generator/invoice_number_generator").
|
||||
to_return(status: 200, body: "{\"invoice_number\":\"#{invoice_n + 3}\"}", headers: {})
|
||||
|
||||
stub_request(:put, "https://registry:3000/eis_billing/e_invoice_response")
|
||||
.to_return(status: 200, body: "{\"invoice_number\":\"#{invoice_n + 3}\"}, {\"date\":\"#{Time.zone.now-10.minutes}\"}", headers: {})
|
||||
|
||||
stub_request(:post, "https://eis_billing_system:3000/api/v1/e_invoice/e_invoice")
|
||||
.to_return(status: 200, body: "", headers: {})
|
||||
|
||||
Setting.registry_vat_prc = 0.1
|
||||
|
||||
visit registrar_invoices_url
|
||||
click_link_or_button 'Add deposit'
|
||||
fill_in 'Amount', with: '25.5'
|
||||
|
||||
assert_difference 'Invoice.count' do
|
||||
click_link_or_button 'Add'
|
||||
end
|
||||
|
||||
invoice = Invoice.last
|
||||
|
||||
assert_equal BigDecimal(10), invoice.vat_rate
|
||||
assert_equal BigDecimal('28.05'), invoice.total
|
||||
assert_text 'Please pay the following invoice'
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,49 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaAdminContactBulkChangeTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_replace_domain_contacts_of_current_registrar
|
||||
request_stub = stub_request(:patch, /domains\/admin_contacts/)
|
||||
.with(body: { current_contact_id: 'william-001', new_contact_id: 'john-001' },
|
||||
basic_auth: ['test_bestnames', 'testtest'])
|
||||
.to_return(body: { data: { affected_domains: %w[foo.test bar.test],
|
||||
skipped_domains: %w[baz.test qux.test] } }.to_json,
|
||||
status: 200)
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
click_link 'Admin contact'
|
||||
|
||||
find('.current_admin_contact').fill_in 'Current contact ID', with: 'william-001'
|
||||
find('.new_admin_contact').fill_in 'New contact ID', with: 'john-001'
|
||||
click_on 'Replace admin contacts'
|
||||
|
||||
assert_requested request_stub
|
||||
assert_current_path registrar_domains_path
|
||||
assert_text 'Admin contacts have been successfully replaced'
|
||||
assert_text 'Affected domains: foo.test, bar.test'
|
||||
assert_text 'Skipped domains: baz.test, qux.test'
|
||||
end
|
||||
|
||||
def test_fails_gracefully
|
||||
stub_request(:patch, /domains\/admin_contacts/)
|
||||
.to_return(status: 400,
|
||||
body: { message: 'epic fail' }.to_json,
|
||||
headers: { 'Content-type' => Mime[:json] })
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
click_link 'Admin contact'
|
||||
|
||||
find('.current_admin_contact').fill_in 'Current contact ID', with: 'william-001'
|
||||
find('.new_admin_contact').fill_in 'New contact ID', with: 'john-001'
|
||||
click_on 'Replace admin contacts'
|
||||
|
||||
assert_text 'epic fail'
|
||||
assert_field 'Current contact ID', with: 'william-001'
|
||||
assert_field 'New contact ID', with: 'john-001'
|
||||
end
|
||||
end
|
|
@ -1,70 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class BulkRenewTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@registrar = users(:api_bestnames).registrar
|
||||
@price = billing_prices(:renew_one_year)
|
||||
end
|
||||
|
||||
def test_shows_domain_list
|
||||
sign_in users(:api_bestnames)
|
||||
travel_to Time.zone.parse('2010-07-05 10:30')
|
||||
|
||||
visit new_registrar_bulk_change_url
|
||||
click_link('Bulk renew')
|
||||
assert_text 'Current balance'
|
||||
page.has_css?('#registrar_balance', text:
|
||||
ApplicationController.helpers.number_to_currency(@registrar.balance))
|
||||
|
||||
select '1 year', from: 'Period'
|
||||
click_button 'Filter'
|
||||
|
||||
@registrar.domains.pluck(:name).each do |domain_name|
|
||||
assert_text domain_name
|
||||
end
|
||||
end
|
||||
|
||||
def test_makes_bulk_renew
|
||||
sign_in users(:api_bestnames)
|
||||
travel_to Time.zone.parse('2010-07-05 10:30')
|
||||
|
||||
req_body = { domains: ["shop.test", "airport.test", "library.test", "invalid.test"], renew_period: "1y" }
|
||||
stub_request(:post, "#{ENV['repp_url']}domains/renew/bulk").with(body: req_body)
|
||||
.to_return(status: 400, body: {
|
||||
code: 2304,
|
||||
message: "Domain renew error for invalid.test",
|
||||
data: {}
|
||||
}.to_json)
|
||||
|
||||
visit new_registrar_bulk_change_url
|
||||
click_link('Bulk renew')
|
||||
select '1 year', from: 'Period'
|
||||
click_button 'Filter'
|
||||
click_button 'Renew'
|
||||
|
||||
assert_text 'Domain renew error for invalid.test'
|
||||
end
|
||||
|
||||
def test_bulk_renew_checks_balance
|
||||
sign_in users(:api_bestnames)
|
||||
@price.update(price_cents: 99999999)
|
||||
travel_to Time.zone.parse('2010-07-05 10:30')
|
||||
|
||||
req_body = { domains: ["shop.test", "airport.test", "library.test", "invalid.test"], renew_period: "1y" }
|
||||
stub_request(:post, "#{ENV['repp_url']}domains/renew/bulk").with(body: req_body)
|
||||
.to_return(status: 400, body: {
|
||||
code: 2304,
|
||||
message: "Not enough funds for renew domains",
|
||||
data: {}
|
||||
}.to_json)
|
||||
|
||||
visit new_registrar_bulk_change_url
|
||||
click_link('Bulk renew')
|
||||
select '1 year', from: 'Period'
|
||||
click_button 'Filter'
|
||||
click_button 'Renew'
|
||||
|
||||
assert_text 'Not enough funds for renew domains'
|
||||
|
||||
end
|
||||
end
|
|
@ -1,42 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaBulkTransferTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:api_goodnames)
|
||||
end
|
||||
|
||||
def test_transfer_multiple_domains_in_bulk
|
||||
request_body = { data: { domain_transfers: [{ domain_name: 'shop.test', transfer_code: '65078d5' }] } }
|
||||
headers = { 'Content-type' => Mime[:json] }
|
||||
request_stub = stub_request(:post, /domains\/transfer/).with(body: request_body,
|
||||
headers: headers,
|
||||
basic_auth: ['test_goodnames', 'testtest'])
|
||||
.to_return(body: { data: { success: [{ type: 'domain_transfer', domain_name: 'shop.test' }],
|
||||
failed: []
|
||||
} }.to_json, status: 200)
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
click_link 'Bulk transfer'
|
||||
attach_file 'Batch file', Rails.root.join('test', 'fixtures', 'files', 'valid_domains_for_transfer.csv').to_s
|
||||
click_button 'Transfer'
|
||||
|
||||
assert_requested request_stub
|
||||
assert_current_path registrar_domains_path
|
||||
assert_text '1 domains have been successfully transferred'
|
||||
end
|
||||
|
||||
def test_fail_gracefully
|
||||
body = { message: 'epic fail' }.to_json
|
||||
headers = { 'Content-type' => Mime[:json] }
|
||||
stub_request(:post, /domains\/transfer/).to_return(status: 400, body: body, headers: headers)
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
click_link 'Bulk transfer'
|
||||
attach_file 'Batch file', Rails.root.join('test', 'fixtures', 'files', 'valid_domains_for_transfer.csv').to_s
|
||||
click_button 'Transfer'
|
||||
|
||||
assert_text 'epic fail'
|
||||
end
|
||||
end
|
|
@ -1,185 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaNameserverBulkChangeTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:api_goodnames)
|
||||
Capybara.default_max_wait_time = 10
|
||||
end
|
||||
|
||||
def test_replaces_current_registrar_nameservers
|
||||
request_body = { data: { type: 'nameserver',
|
||||
id: 'ns1.bestnames.test',
|
||||
domains: [],
|
||||
attributes: { hostname: 'new-ns.bestnames.test',
|
||||
ipv4: %w[192.0.2.55 192.0.2.56],
|
||||
ipv6: %w[2001:db8::55 2001:db8::56] } } }
|
||||
request_stub = stub_request(:put, /registrar\/nameservers/).with(body: request_body,
|
||||
headers: { 'Content-type' => Mime[:json] },
|
||||
basic_auth: ['test_goodnames', 'testtest'])
|
||||
.to_return(body: { data: {
|
||||
type: 'nameserver',
|
||||
id: 'new-ns.bestnames.test',
|
||||
affected_domains: ["airport.test", "shop.test"],
|
||||
skipped_domains: []
|
||||
}
|
||||
}.to_json, status: 200)
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
click_link 'Nameserver'
|
||||
|
||||
fill_in 'Old hostname (optional)', with: 'ns1.bestnames.test'
|
||||
fill_in 'New hostname', with: 'new-ns.bestnames.test'
|
||||
fill_in 'ipv4', with: "192.0.2.55\n192.0.2.56"
|
||||
fill_in 'ipv6', with: "2001:db8::55\n2001:db8::56"
|
||||
click_on 'Replace/Add nameserver'
|
||||
|
||||
assert_requested request_stub
|
||||
assert_current_path registrar_domains_path
|
||||
assert_text 'Nameserver have been successfully replaced'
|
||||
assert_text 'Affected domains: airport.test, shop.test'
|
||||
end
|
||||
|
||||
def test_fails_gracefully
|
||||
stub_request(:put, /registrar\/nameservers/).to_return(status: 400,
|
||||
body: { message: 'epic fail' }.to_json,
|
||||
headers: { 'Content-type' => Mime[:json] })
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
click_link 'Nameserver'
|
||||
|
||||
fill_in 'Old hostname (optional)', with: 'old hostname'
|
||||
fill_in 'New hostname', with: 'new hostname'
|
||||
fill_in 'ipv4', with: 'ipv4'
|
||||
fill_in 'ipv6', with: 'ipv6'
|
||||
click_on 'Replace/Add nameserver'
|
||||
|
||||
assert_text 'epic fail'
|
||||
assert_field 'Old hostname (optional)', with: 'old hostname'
|
||||
assert_field 'New hostname', with: 'new hostname'
|
||||
assert_field 'ipv4', with: 'ipv4'
|
||||
assert_field 'ipv6', with: 'ipv6'
|
||||
end
|
||||
|
||||
def test_replaces_nameservers_only_for_scoped_domains
|
||||
request_body = { data: { type: 'nameserver',
|
||||
id: 'ns1.bestnames.test',
|
||||
domains: ['shop.test'],
|
||||
attributes: { hostname: 'new-ns.bestnames.test',
|
||||
ipv4: %w[192.0.2.55 192.0.2.56],
|
||||
ipv6: %w[2001:db8::55 2001:db8::56] } } }
|
||||
request_stub = stub_request(:put, /registrar\/nameservers/).with(body: request_body,
|
||||
headers: { 'Content-type' => Mime[:json] },
|
||||
basic_auth: ['test_goodnames', 'testtest'])
|
||||
.to_return(body: { data: {
|
||||
type: 'nameserver',
|
||||
id: 'new-ns.bestnames.test',
|
||||
affected_domains: ["shop.test"],
|
||||
skipped_domains: []}}.to_json, status: 200)
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
click_link 'Nameserver'
|
||||
|
||||
fill_in 'Old hostname (optional)', with: 'ns1.bestnames.test'
|
||||
fill_in 'New hostname', with: 'new-ns.bestnames.test'
|
||||
fill_in 'ipv4', with: "192.0.2.55\n192.0.2.56"
|
||||
fill_in 'ipv6', with: "2001:db8::55\n2001:db8::56"
|
||||
attach_file :puny_file, Rails.root.join('test', 'fixtures', 'files', 'valid_domains_for_ns_replacement.csv').to_s
|
||||
|
||||
click_on 'Replace/Add nameserver'
|
||||
|
||||
assert_requested request_stub
|
||||
assert_current_path registrar_domains_path
|
||||
assert_text 'Nameserver have been successfully replaced'
|
||||
assert_text 'Affected domains: shop.test'
|
||||
end
|
||||
|
||||
def test_replaces_nameservers_with_invalid_domains_list
|
||||
nameserver = nameservers(:shop_ns1)
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
click_link 'Nameserver'
|
||||
|
||||
fill_in 'Old hostname (optional)', with: nameserver.hostname
|
||||
fill_in 'New hostname', with: 'new-ns.bestnames.test'
|
||||
fill_in 'ipv4', with: "192.0.2.55\n192.0.2.56"
|
||||
fill_in 'ipv6', with: "2001:db8::55\n2001:db8::56"
|
||||
attach_file :puny_file, Rails.root.join('test', 'fixtures', 'files', 'invalid_domains_for_ns_replacement.csv').to_s
|
||||
|
||||
assert_no_changes -> { nameserver.hostname } do
|
||||
click_on 'Replace/Add nameserver'
|
||||
end
|
||||
|
||||
assert_current_path registrar_domains_path
|
||||
assert_text 'CSV scoped domain list seems empty. Make sure that domains are added and "Domain" header is present.'
|
||||
end
|
||||
|
||||
def test_adding_current_registrar_nameservers
|
||||
request_body = { data: { type: 'nameserver',
|
||||
id: '',
|
||||
domains: [],
|
||||
attributes: { hostname: 'new-ns2.bestnames.test',
|
||||
ipv4: %w[192.0.2.55 192.0.2.56],
|
||||
ipv6: %w[2001:db8::55 2001:db8::56] } } }
|
||||
request_stub = stub_request(:put, /registrar\/nameservers/).with(body: request_body,
|
||||
headers: { 'Content-type' => Mime[:json] },
|
||||
basic_auth: ['test_goodnames', 'testtest'])
|
||||
.to_return(body: { data: {
|
||||
type: 'nameserver',
|
||||
id: 'new-ns2.bestnames.test',
|
||||
affected_domains: ["airport.test", "shop.test"],
|
||||
skipped_domains: []
|
||||
}
|
||||
}.to_json, status: 200)
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
click_link 'Nameserver'
|
||||
|
||||
fill_in 'New hostname', with: 'new-ns2.bestnames.test'
|
||||
fill_in 'ipv4', with: "192.0.2.55\n192.0.2.56"
|
||||
fill_in 'ipv6', with: "2001:db8::55\n2001:db8::56"
|
||||
click_on 'Replace/Add nameserver'
|
||||
|
||||
assert_requested request_stub
|
||||
assert_current_path registrar_domains_path
|
||||
assert_text 'Nameserver have been successfully added'
|
||||
assert_text 'Affected domains: airport.test, shop.test'
|
||||
end
|
||||
|
||||
def test_adding_nameservers_only_for_scoped_domains
|
||||
request_body = { data: { type: 'nameserver',
|
||||
id: '',
|
||||
domains: ['shop.test'],
|
||||
attributes: { hostname: 'new-ns1.bestnames.test',
|
||||
ipv4: %w[192.0.2.55 192.0.2.56],
|
||||
ipv6: %w[2001:db8::55 2001:db8::56] } } }
|
||||
request_stub = stub_request(:put, /registrar\/nameservers/).with(body: request_body,
|
||||
headers: { 'Content-type' => Mime[:json] },
|
||||
basic_auth: ['test_goodnames', 'testtest'])
|
||||
.to_return(body: { data: {
|
||||
type: 'nameserver',
|
||||
id: 'new-ns1.bestnames.test',
|
||||
affected_domains: ["shop.test"],
|
||||
skipped_domains: []}}.to_json, status: 200)
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
click_link 'Nameserver'
|
||||
|
||||
fill_in 'New hostname', with: 'new-ns1.bestnames.test'
|
||||
fill_in 'ipv4', with: "192.0.2.55\n192.0.2.56"
|
||||
fill_in 'ipv6', with: "2001:db8::55\n2001:db8::56"
|
||||
attach_file :puny_file, Rails.root.join('test', 'fixtures', 'files', 'valid_domains_for_ns_replacement.csv').to_s
|
||||
|
||||
click_on 'Replace/Add nameserver'
|
||||
|
||||
assert_requested request_stub
|
||||
assert_current_path registrar_domains_path
|
||||
assert_text 'Nameserver have been successfully added'
|
||||
assert_text 'Affected domains: shop.test'
|
||||
end
|
||||
end
|
|
@ -1,47 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaTechContactBulkChangeTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_replace_domain_contacts_of_current_registrar
|
||||
request_stub = stub_request(:patch, /domains\/contacts/)
|
||||
.with(body: { current_contact_id: 'william-001', new_contact_id: 'john-001' },
|
||||
basic_auth: ['test_bestnames', 'testtest'])
|
||||
.to_return(body: { data: { affected_domains: %w[foo.test bar.test],
|
||||
skipped_domains: %w[baz.test qux.test] } }.to_json,
|
||||
status: 200)
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
|
||||
find('.current_tech_contact').fill_in 'Current contact ID', with: 'william-001'
|
||||
find('.new_tech_contact').fill_in 'New contact ID', with: 'john-001'
|
||||
click_on 'Replace technical contacts'
|
||||
|
||||
assert_requested request_stub
|
||||
assert_current_path registrar_domains_path
|
||||
assert_text 'Technical contacts have been successfully replaced'
|
||||
assert_text 'Affected domains: foo.test, bar.test'
|
||||
assert_text 'Skipped domains: baz.test, qux.test'
|
||||
end
|
||||
|
||||
def test_fails_gracefully
|
||||
stub_request(:patch, /domains\/contacts/)
|
||||
.to_return(status: 400,
|
||||
body: { message: 'epic fail' }.to_json,
|
||||
headers: { 'Content-type' => Mime[:json] })
|
||||
|
||||
visit registrar_domains_url
|
||||
click_link 'Bulk change'
|
||||
|
||||
find('.current_tech_contact').fill_in 'Current contact ID', with: 'william-001'
|
||||
find('.new_tech_contact').fill_in 'New contact ID', with: 'john-001'
|
||||
click_on 'Replace technical contacts'
|
||||
|
||||
assert_text 'epic fail'
|
||||
assert_field 'Current contact ID', with: 'william-001'
|
||||
assert_field 'New contact ID', with: 'john-001'
|
||||
end
|
||||
end
|
|
@ -1,45 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaContactTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@registrar = registrars(:bestnames)
|
||||
@contact = contacts(:john)
|
||||
sign_in users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_creates_contact_with_invalid_phone
|
||||
visit registrar_contacts_path
|
||||
click_on 'New'
|
||||
|
||||
fill_in 'depp_contact_ident', with: @contact.ident
|
||||
fill_in 'depp_contact_name', with: @contact.name
|
||||
fill_in 'depp_contact_email', with: @contact.email
|
||||
fill_in 'depp_contact_phone', with: '372'
|
||||
click_on 'Create'
|
||||
|
||||
assert_text 'Phone number must be in +XXX.YYYYYYY format'
|
||||
end
|
||||
|
||||
def test_updates_contact_with_invalid_phone
|
||||
depp_contact = Depp::Contact.new(
|
||||
id: @contact.id,
|
||||
name: @contact.name,
|
||||
code: @contact.code,
|
||||
email: @contact.email,
|
||||
phone: @contact.phone,
|
||||
ident: @contact.ident,
|
||||
ident_type: @contact.ident_type,
|
||||
ident_country_code: @contact.ident_country_code)
|
||||
|
||||
Spy.on(Depp::Contact, :find_by_id).and_return(depp_contact)
|
||||
|
||||
visit edit_registrar_contact_path(depp_contact.code)
|
||||
|
||||
assert_text "Edit: #{depp_contact.name}"
|
||||
|
||||
fill_in 'depp_contact_phone', with: '372'
|
||||
click_on 'Save'
|
||||
|
||||
assert_text 'Phone number must be in +XXX.YYYYYYY format'
|
||||
end
|
||||
end
|
|
@ -1,21 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarDomainsTest < ApplicationSystemTestCase
|
||||
def test_downloads_domain_list_as_csv
|
||||
sign_in users(:api_bestnames)
|
||||
travel_to Time.zone.parse('2010-07-05 10:30')
|
||||
|
||||
expected_csv = <<-CSV.strip_heredoc
|
||||
Domain,Transfer code,Registrant name,Registrant code,Date of expiry
|
||||
library.test,45118f5,Acme Ltd,acme-ltd-001,2010-07-05
|
||||
shop.test,65078d5,John,john-001,2010-07-05
|
||||
invalid.test,1438d6,any,invalid,2010-07-05
|
||||
airport.test,55438j5,John,john-001,2010-07-05
|
||||
CSV
|
||||
|
||||
visit registrar_domains_url
|
||||
click_button 'Download CSV'
|
||||
assert_equal "attachment; filename=\"Domains_2010-07-05_10.30.csv\"; filename*=UTF-8''Domains_2010-07-05_10.30.csv", response_headers['Content-Disposition']
|
||||
assert_equal expected_csv, page.body
|
||||
end
|
||||
end
|
|
@ -1,40 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class ListInvoicesTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@user = users(:api_bestnames)
|
||||
@invoice = invoices(:one)
|
||||
|
||||
sign_in @user
|
||||
end
|
||||
|
||||
def test_show_balance
|
||||
visit registrar_invoices_path
|
||||
assert_text "Your current account balance is 100,00 EUR"
|
||||
end
|
||||
|
||||
def test_shows_invoice_title
|
||||
visit registrar_invoices_path
|
||||
assert_text 'Invoice', minimum: 2
|
||||
end
|
||||
|
||||
def test_shows_invoice_owned_by_current_user
|
||||
owning_registrar = registrars(:bestnames)
|
||||
assert_equal owning_registrar, @user.registrar
|
||||
@invoice.update!(buyer: owning_registrar)
|
||||
|
||||
visit registrar_invoices_url
|
||||
|
||||
assert_text @invoice.to_s
|
||||
end
|
||||
|
||||
def test_hides_invoice_owned_by_other_user
|
||||
other_registrar = registrars(:goodnames)
|
||||
assert_not_equal other_registrar, @user.registrar
|
||||
@invoice.update!(buyer: other_registrar)
|
||||
|
||||
visit registrar_invoices_url
|
||||
|
||||
assert_no_text @invoice.to_s
|
||||
end
|
||||
end
|
|
@ -1,28 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class NewInvoicePaymentTest < ApplicationSystemTestCase
|
||||
def setup
|
||||
super
|
||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
||||
Spy.on_instance_method(EisBilling::AddDeposits, :send_invoice).and_return(eis_response)
|
||||
|
||||
@original_vat_prc = Setting.registry_vat_prc
|
||||
Setting.registry_vat_prc = 0.2
|
||||
@user = users(:api_bestnames)
|
||||
sign_in @user
|
||||
end
|
||||
|
||||
def teardown
|
||||
super
|
||||
|
||||
Setting.registry_vat_prc = @original_vat_prc
|
||||
end
|
||||
|
||||
def create_invoice_and_visit_its_page
|
||||
visit registrar_invoices_path
|
||||
click_link_or_button 'Add deposit'
|
||||
fill_in 'Amount', with: '200.00'
|
||||
fill_in 'Description', with: 'My first invoice'
|
||||
click_link_or_button 'Add'
|
||||
end
|
||||
end
|
|
@ -1,100 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class NewInvoiceTest < ApplicationSystemTestCase
|
||||
def setup
|
||||
super
|
||||
|
||||
@user = users(:api_bestnames)
|
||||
sign_in @user
|
||||
|
||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
||||
Spy.on_instance_method(EisBilling::AddDeposits, :send_invoice).and_return(eis_response)
|
||||
end
|
||||
|
||||
def test_show_balance
|
||||
visit registrar_invoices_path
|
||||
assert_text "Your current account balance is 100,00 EUR"
|
||||
end
|
||||
|
||||
def test_create_new_invoice_with_positive_amount
|
||||
if Feature.billing_system_integrated?
|
||||
invoice_n = Invoice.order(number: :desc).last.number
|
||||
stub_request(:post, "https://eis_billing_system:3000/api/v1/invoice_generator/invoice_number_generator").
|
||||
to_return(status: 200, body: "{\"invoice_number\":\"#{invoice_n + 3}\"}", headers: {})
|
||||
|
||||
stub_request(:put, "https://registry:3000/eis_billing/e_invoice_response").
|
||||
to_return(status: 200, body: "{\"invoice_number\":\"#{invoice_n + 3}\"}, {\"date\":\"#{Time.zone.now-10.minutes}\"}", headers: {})
|
||||
|
||||
stub_request(:post, "https://eis_billing_system:3000/api/v1/e_invoice/e_invoice").
|
||||
to_return(status: 200, body: "", headers: {})
|
||||
|
||||
visit registrar_invoices_path
|
||||
click_link_or_button 'Add deposit'
|
||||
fill_in 'Amount', with: '200.00'
|
||||
fill_in 'Description', with: 'My first invoice'
|
||||
|
||||
assert_difference 'Invoice.count', 1 do
|
||||
click_link_or_button 'Add'
|
||||
end
|
||||
|
||||
assert_text 'Please pay the following invoice'
|
||||
assert_text "Invoice no. #{invoice_n + 3}"
|
||||
assert_text 'Subtotal 200,00 €'
|
||||
assert_text 'Pay invoice'
|
||||
end
|
||||
end
|
||||
|
||||
def test_create_new_invoice_with_comma_in_number
|
||||
if Feature.billing_system_integrated?
|
||||
invoice_n = Invoice.order(number: :desc).last.number
|
||||
stub_request(:post, "https://eis_billing_system:3000/api/v1/invoice_generator/invoice_number_generator").
|
||||
to_return(status: 200, body: "{\"invoice_number\":\"#{invoice_n + 3}\"}", headers: {})
|
||||
|
||||
stub_request(:put, "https://registry:3000/eis_billing/e_invoice_response").
|
||||
to_return(status: 200, body: "{\"invoice_number\":\"#{invoice_n + 3}\"}, {\"date\":\"#{Time.zone.now-10.minutes}\"}", headers: {})
|
||||
|
||||
stub_request(:post, "https://eis_billing_system:3000/api/v1/e_invoice/e_invoice").
|
||||
to_return(status: 200, body: "", headers: {})
|
||||
|
||||
visit registrar_invoices_path
|
||||
click_link_or_button 'Add deposit'
|
||||
fill_in 'Amount', with: '200,00'
|
||||
fill_in 'Description', with: 'My first invoice'
|
||||
|
||||
assert_difference 'Invoice.count', 1 do
|
||||
click_link_or_button 'Add'
|
||||
end
|
||||
|
||||
assert_text 'Please pay the following invoice'
|
||||
assert_text "Invoice no. #{invoice_n + 3}"
|
||||
assert_text 'Subtotal 200,00 €'
|
||||
assert_text 'Pay invoice'
|
||||
end
|
||||
end
|
||||
|
||||
def test_create_new_invoice_fails_when_amount_is_0
|
||||
visit registrar_invoices_path
|
||||
click_link_or_button 'Add deposit'
|
||||
fill_in 'Amount', with: '0.00'
|
||||
fill_in 'Description', with: 'My first invoice'
|
||||
|
||||
assert_no_difference 'Invoice.count' do
|
||||
click_link_or_button 'Add'
|
||||
end
|
||||
|
||||
assert_text 'Amount is too small. Minimum deposit is 0.01 EUR'
|
||||
end
|
||||
|
||||
def test_create_new_invoice_fails_when_amount_is_negative
|
||||
visit registrar_invoices_path
|
||||
click_link_or_button 'Add deposit'
|
||||
fill_in 'Amount', with: '-120.00'
|
||||
fill_in 'Description', with: 'My first invoice'
|
||||
|
||||
assert_no_difference 'Invoice.count' do
|
||||
click_link_or_button 'Add'
|
||||
end
|
||||
|
||||
assert_text 'Amount is too small. Minimum deposit is 0.01 EUR'
|
||||
end
|
||||
end
|
|
@ -1,61 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaInvoicesTest < ApplicationSystemTestCase
|
||||
include ActionMailer::TestHelper
|
||||
|
||||
setup do
|
||||
sign_in users(:api_bestnames)
|
||||
@invoice = invoices(:one)
|
||||
|
||||
ActionMailer::Base.deliveries.clear
|
||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
||||
Spy.on_instance_method(EisBilling::AddDeposits, :send_invoice).and_return(eis_response)
|
||||
end
|
||||
|
||||
def test_cancels_an_invoice
|
||||
Spy.on(EisBilling::SendInvoiceStatus, :send_info).and_return(true)
|
||||
|
||||
@invoice.account_activity = nil
|
||||
assert @invoice.cancellable?
|
||||
|
||||
visit registrar_invoice_url(@invoice)
|
||||
click_on 'Cancel'
|
||||
@invoice.reload
|
||||
|
||||
assert @invoice.cancelled?
|
||||
assert_text 'Invoice has been cancelled'
|
||||
end
|
||||
|
||||
def test_invoice_delivery_form_is_pre_populated_with_billing_email_of_a_registrar
|
||||
assert_equal 'billing@bestnames.test', @invoice.buyer.billing_email
|
||||
visit new_registrar_invoice_delivery_url(@invoice)
|
||||
assert_field 'Recipient', with: 'billing@bestnames.test'
|
||||
end
|
||||
|
||||
def test_delivers_an_invoice
|
||||
visit registrar_invoice_url(@invoice)
|
||||
click_on 'Send'
|
||||
fill_in 'Recipient', with: 'billing@registrar.test'
|
||||
click_on 'Send'
|
||||
|
||||
assert_emails 1
|
||||
email = ActionMailer::Base.deliveries.first
|
||||
assert_equal ['billing@registrar.test'], email.to
|
||||
assert_current_path registrar_invoice_path(@invoice)
|
||||
assert_text 'Invoice has been sent'
|
||||
end
|
||||
|
||||
def test_if_invoice_unpaid_and_not_generated_link_comes_then_should_render_no_everypay_link
|
||||
invoice = invoices(:unpaid)
|
||||
visit registrar_invoice_url(invoice)
|
||||
|
||||
assert_text 'No everypay link'
|
||||
end
|
||||
|
||||
def test_if_invoice_aldready_paid_there_should_not_any_everypay_link
|
||||
visit registrar_invoice_url(@invoice)
|
||||
|
||||
assert_no_text 'No everypay link'
|
||||
assert_no_text 'Everypay link'
|
||||
end
|
||||
end
|
|
@ -1,25 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaProtectedAreaTest < ApplicationSystemTestCase
|
||||
def test_anonymous_user_is_asked_to_authenticate_when_navigating_to_protected_area
|
||||
visit registrar_domains_url
|
||||
assert_text 'You need to sign in before continuing'
|
||||
assert_current_path new_registrar_user_session_path
|
||||
end
|
||||
|
||||
def test_authenticated_user_can_access_protected_area
|
||||
sign_in users(:api_bestnames)
|
||||
visit registrar_domains_url
|
||||
|
||||
assert_no_text 'You need to sign in before continuing'
|
||||
assert_current_path registrar_domains_path
|
||||
end
|
||||
|
||||
def test_authenticated_user_is_not_asked_to_authenticate_again
|
||||
sign_in users(:api_bestnames)
|
||||
visit new_registrar_user_session_url
|
||||
|
||||
assert_text 'You are already signed in'
|
||||
assert_current_path registrar_root_path
|
||||
end
|
||||
end
|
|
@ -1,74 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaSettingsBalanceAutoReloadTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@registrar = registrars(:bestnames)
|
||||
@user = users(:api_bestnames)
|
||||
sign_in @user
|
||||
end
|
||||
|
||||
def test_enables_balance_auto_reload
|
||||
amount = 100
|
||||
threshold = 10
|
||||
assert_nil @registrar.settings['balance_auto_reload']
|
||||
|
||||
visit registrar_account_path
|
||||
click_on 'Enable'
|
||||
fill_in 'Amount', with: amount
|
||||
fill_in 'Threshold', with: threshold
|
||||
click_button 'Save'
|
||||
|
||||
assert_current_path registrar_account_path
|
||||
assert_text 'Balance Auto-Reload setting has been updated'
|
||||
|
||||
# Using `number_to_currency` leads to `expected to find text "Reload 100,00 € when your balance
|
||||
# drops to 10,00 €" in "...Reload 100,00 € when your balance drops to 10,00 €...`
|
||||
assert_text 'Reload 100,00 € when your balance drops to 10,00 €'
|
||||
end
|
||||
|
||||
def test_disables_balance_auto_reload
|
||||
@registrar.update!(settings: { balance_auto_reload: { type: {} } })
|
||||
|
||||
visit registrar_account_path
|
||||
click_on 'Disable'
|
||||
|
||||
assert_current_path registrar_account_path
|
||||
assert_text 'Balance Auto-Reload setting has been disabled'
|
||||
end
|
||||
|
||||
def test_edits_balance_auto_reload
|
||||
@registrar.update!(settings: { balance_auto_reload: { type: { name: 'threshold',
|
||||
amount: 100,
|
||||
threshold: 10 } } })
|
||||
|
||||
visit registrar_account_path
|
||||
within '.balance-auto-reload' do
|
||||
click_on 'Edit'
|
||||
end
|
||||
fill_in 'Amount', with: '101'
|
||||
fill_in 'Threshold', with: '11'
|
||||
click_button 'Save'
|
||||
|
||||
assert_current_path registrar_account_path
|
||||
assert_text 'Balance Auto-Reload setting has been updated'
|
||||
end
|
||||
|
||||
def test_form_is_pre_populated_when_editing
|
||||
amount = 100
|
||||
threshold = 10
|
||||
@registrar.update!(settings: { balance_auto_reload: { type: { name: 'threshold',
|
||||
amount: amount,
|
||||
threshold: threshold } } })
|
||||
|
||||
visit edit_registrar_settings_balance_auto_reload_path
|
||||
|
||||
assert_field 'Amount', with: amount
|
||||
assert_field 'Threshold', with: threshold
|
||||
end
|
||||
|
||||
def test_user_of_epp_role_cannot_edit_balance_auto_reload_setting
|
||||
@user.update!(roles: [ApiUser::EPP])
|
||||
visit registrar_account_path
|
||||
assert_no_text 'Balance Auto-Reload'
|
||||
end
|
||||
end
|
|
@ -1,52 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaPasswordSignInTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@user = users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_correct_username_and_password
|
||||
login_with_correct_credentials
|
||||
assert_text 'Log out'
|
||||
assert_current_path registrar_root_path
|
||||
end
|
||||
|
||||
def test_after_successful_sign_in_super_user_sees_service_message_list
|
||||
@user.update!(roles: [ApiUser::SUPER])
|
||||
login_with_correct_credentials
|
||||
assert_current_path registrar_root_path
|
||||
end
|
||||
|
||||
def test_after_successful_sign_in_billing_user_sees_account
|
||||
@user.update!(roles: [ApiUser::BILLING])
|
||||
login_with_correct_credentials
|
||||
assert_current_path registrar_account_path
|
||||
end
|
||||
|
||||
def test_wrong_password
|
||||
visit new_registrar_user_session_url
|
||||
fill_in 'registrar_user_username', with: @user.username
|
||||
fill_in 'registrar_user_password', with: 'wrong'
|
||||
click_button 'Login'
|
||||
|
||||
assert_text 'No such user'
|
||||
assert_current_path new_registrar_user_session_path
|
||||
end
|
||||
|
||||
def test_inactive_user
|
||||
@user.update!(active: false)
|
||||
login_with_correct_credentials
|
||||
|
||||
assert_text 'User is not active'
|
||||
assert_current_path new_registrar_user_session_path
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def login_with_correct_credentials
|
||||
visit new_registrar_user_session_url
|
||||
fill_in 'registrar_user_username', with: @user.username
|
||||
fill_in 'registrar_user_password', with: 'testtest'
|
||||
click_button 'Login'
|
||||
end
|
||||
end
|
|
@ -1,15 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaSignOutTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_logout
|
||||
visit registrar_root_url
|
||||
click_on 'Log out'
|
||||
|
||||
assert_text 'Signed out successfully'
|
||||
assert_current_path new_registrar_user_session_path
|
||||
end
|
||||
end
|
|
@ -1,63 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class TaraUsersTest < ApplicationSystemTestCase
|
||||
def setup
|
||||
super
|
||||
|
||||
OmniAuth.config.test_mode = true
|
||||
@user = users(:api_bestnames)
|
||||
|
||||
@existing_user_hash = {
|
||||
'provider' => 'tara',
|
||||
'uid' => "EE" + @user.identity_code
|
||||
}
|
||||
|
||||
@new_user_hash = {
|
||||
'provider' => 'tara',
|
||||
'uid' => 'EE51007050604'
|
||||
}
|
||||
end
|
||||
|
||||
def teardown
|
||||
super
|
||||
|
||||
OmniAuth.config.test_mode = false
|
||||
OmniAuth.config.mock_auth['tara'] = nil
|
||||
end
|
||||
|
||||
def test_existing_user_gets_signed_in
|
||||
OmniAuth.config.mock_auth[:tara] = OmniAuth::AuthHash.new(@existing_user_hash)
|
||||
|
||||
visit new_registrar_user_session_path
|
||||
click_link('Sign in')
|
||||
|
||||
assert_text('Signed in successfully')
|
||||
end
|
||||
|
||||
def test_existing_user_logs_in_without_cookie_overflow
|
||||
@existing_user_hash['credentials'] = massive_hash
|
||||
OmniAuth.config.mock_auth[:tara] = OmniAuth::AuthHash.new(@existing_user_hash)
|
||||
|
||||
visit new_registrar_user_session_path
|
||||
assert_nothing_raised do
|
||||
click_link('Sign in')
|
||||
end
|
||||
|
||||
assert_text('Signed in successfully')
|
||||
end
|
||||
|
||||
def test_nonexisting_user_gets_error_message
|
||||
OmniAuth.config.mock_auth[:tara] = OmniAuth::AuthHash.new(@new_user_hash)
|
||||
|
||||
visit new_registrar_user_session_path
|
||||
click_link('Sign in')
|
||||
|
||||
assert_text('No such user')
|
||||
end
|
||||
|
||||
def massive_hash
|
||||
o = [('a'..'z'), ('A'..'Z')].map(&:to_a).flatten
|
||||
string = (0...5000).map { o[rand(o.length)] }.join
|
||||
{"access_token":"AT-540-Fj5gbPvJp4jPkO-4EdgzIhIhhJapoRTM","token_type":"bearer","expires_in":600,"id_token":string}
|
||||
end
|
||||
end
|
|
@ -1,33 +0,0 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarAreaXmlConsolesTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_epp_server_does_not_response
|
||||
visit registrar_xml_console_path
|
||||
fill_in 'payload', with: schema_example
|
||||
click_on 'Send EPP Request'
|
||||
|
||||
el = page.find('.CodeRay', visible: :all)
|
||||
assert el.text.include? 'CONNECTION ERROR - Is the EPP server running?'
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def schema_example
|
||||
<<~XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||
<command>
|
||||
<check>
|
||||
<domain:check xmlns:domain="https://epp.tld.ee/schema/domain-ee-1.2.xsd">
|
||||
<domain:name>auction.test</domain:name>
|
||||
</domain:check>
|
||||
</check>
|
||||
</command>
|
||||
</epp>
|
||||
XML
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue