mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
Merge branch 'master' into credit-and-debit-card-payments
This commit is contained in:
commit
eda6772c6f
112 changed files with 887 additions and 438 deletions
16
test/integration/admin/domains/details_test.rb
Normal file
16
test/integration/admin/domains/details_test.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AdminAreaDomainDetailsTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
login_as users(:admin)
|
||||
@domain = domains(:shop)
|
||||
end
|
||||
|
||||
def test_discarded_domain_has_corresponding_label
|
||||
visit admin_domain_url(@domain)
|
||||
assert_no_css 'span.label.label-warning', text: 'deleteCandidate'
|
||||
@domain.discard
|
||||
visit admin_domain_url(@domain)
|
||||
assert_css 'span.label.label-warning', text: 'deleteCandidate'
|
||||
end
|
||||
end
|
|
@ -3,7 +3,7 @@ require 'test_helper'
|
|||
class AdminAreaDomainForceDeleteTest < ActionDispatch::IntegrationTest
|
||||
include ActionMailer::TestHelper
|
||||
|
||||
def setup
|
||||
setup do
|
||||
login_as users(:admin)
|
||||
@domain = domains(:shop)
|
||||
ActionMailer::Base.deliveries.clear
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AdminDomainsTestTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
login_as users(:admin)
|
||||
end
|
||||
|
||||
|
|
14
test/integration/admin/mail_templates/new_test.rb
Normal file
14
test/integration/admin/mail_templates/new_test.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AdminAreaNewMailTemplateTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
login_as users(:admin)
|
||||
end
|
||||
|
||||
def test_new_mail_template_does_not_throw_template_error
|
||||
visit admin_mail_templates_url
|
||||
click_link_or_button 'New'
|
||||
assert_text "HTML body"
|
||||
assert_text "New mail template"
|
||||
end
|
||||
end
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AdminAreaDeleteRegistrarTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
login_as users(:admin)
|
||||
end
|
||||
|
||||
|
|
18
test/integration/admin/registrars/details_test.rb
Normal file
18
test/integration/admin/registrars/details_test.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AdminAreaRegistrarDetailsTest < ActionDispatch::IntegrationTest
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
setup do
|
||||
login_as users(:admin)
|
||||
@registrar = registrars(:complete)
|
||||
end
|
||||
|
||||
def test_registrar_details
|
||||
visit admin_registrar_path(@registrar)
|
||||
assert_text 'Accounting customer code US0001'
|
||||
assert_text 'VAT number US12345'
|
||||
assert_text 'VAT rate 5.0%'
|
||||
assert_text 'Language English'
|
||||
end
|
||||
end
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AdminAreaEditRegistrarTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
login_as users(:admin)
|
||||
@registrar = registrars(:bestnames)
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AdminAreaNewRegistrarTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
login_as users(:admin)
|
||||
end
|
||||
|
||||
|
@ -12,6 +12,7 @@ class AdminAreaNewRegistrarTest < ActionDispatch::IntegrationTest
|
|||
fill_in 'Name', with: 'Brand new names'
|
||||
fill_in 'Reg no', with: '55555555'
|
||||
fill_in 'Contact e-mail', with: 'test@example.com'
|
||||
select 'United States', from: 'Country'
|
||||
fill_in 'Accounting customer code', with: 'test'
|
||||
fill_in 'Code', with: 'test'
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ShowRegistrarTest < ActionDispatch::IntegrationTest
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
def setup
|
||||
login_as users(:admin)
|
||||
@registrar = registrars(:bestnames)
|
||||
visit admin_registrar_path(@registrar)
|
||||
end
|
||||
|
||||
def test_accounting_customer_code
|
||||
assert_text 'bestnames'
|
||||
end
|
||||
|
||||
def test_language
|
||||
assert_text 'Language English'
|
||||
end
|
||||
end
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class APIDomainTransfersTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
@domain = domains(:shop)
|
||||
@new_registrar = registrars(:goodnames)
|
||||
Setting.transfer_wait_time = 0 # Auto-approval
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainCreateTransferCodeTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
end
|
||||
|
||||
|
|
|
@ -25,4 +25,31 @@ class EppDomainDeleteTest < ActionDispatch::IntegrationTest
|
|||
assert_equal '1001', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||
assert_equal 1, Nokogiri::XML(response.body).css('result').size
|
||||
end
|
||||
|
||||
def test_discarded_domain_cannot_be_deleted
|
||||
domains(:shop).discard
|
||||
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||
<command>
|
||||
<delete>
|
||||
<domain:delete xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>shop.test</domain:name>
|
||||
</domain:delete>
|
||||
</delete>
|
||||
<extension>
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:legalDocument type="pdf">dGVzdCBmYWlsCg==</eis:legalDocument>
|
||||
</eis:extdata>
|
||||
</extension>
|
||||
</command>
|
||||
</epp>
|
||||
XML
|
||||
|
||||
assert_no_difference 'Domain.count' do
|
||||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_equal '2105', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'test_helper'
|
|||
class EppDomainRenewTest < ActionDispatch::IntegrationTest
|
||||
self.use_transactional_fixtures = false
|
||||
|
||||
def setup
|
||||
setup do
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainUpdateTest < ActionDispatch::IntegrationTest
|
||||
def test_overwrites_existing
|
||||
def test_update_domain
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||
|
@ -20,9 +20,29 @@ class EppDomainUpdateTest < ActionDispatch::IntegrationTest
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
assert_equal 'f0ff7d17b0', domains(:shop).transfer_code
|
||||
assert_equal '1000', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||
assert_equal 1, Nokogiri::XML(response.body).css('result').size
|
||||
end
|
||||
|
||||
def test_discarded_domain_cannot_be_updated
|
||||
domains(:shop).discard
|
||||
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||
<command>
|
||||
<update>
|
||||
<domain:update xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>shop.test</domain:name>
|
||||
</domain:update>
|
||||
</update>
|
||||
</command>
|
||||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
assert_equal '2105', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||
end
|
||||
end
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainTransferRequestTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
@domain = domains(:shop)
|
||||
@new_registrar = registrars(:goodnames)
|
||||
Setting.transfer_wait_time = 0
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppLoginSessionLimitTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
EppSession.delete_all
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrantDomainsTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
login_as users(:registrant)
|
||||
|
||||
Setting.days_to_keep_business_registry_cache = 1
|
||||
|
|
25
test/integration/registrar/billing/balance_top_up_test.rb
Normal file
25
test/integration/registrar/billing/balance_top_up_test.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
require 'test_helper'
|
||||
|
||||
class BalanceTopUpTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
login_as users(:api_bestnames)
|
||||
end
|
||||
|
||||
def test_creates_new_invoice
|
||||
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
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrarDomainTransfersTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
WebMock.reset!
|
||||
login_as users(:api_goodnames)
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrarNameserverReplacementTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
setup do
|
||||
WebMock.reset!
|
||||
login_as users(:api_goodnames)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue