mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 03:58:27 +02:00
Merge remote-tracking branch 'origin/master' into 1422-record-payment-method-and-failed-payments
This commit is contained in:
commit
5d999f96c5
75 changed files with 847 additions and 782 deletions
|
@ -36,22 +36,22 @@ class DepositTest < ActiveSupport::TestCase
|
|||
|
||||
def test_amount_is_converted_from_string
|
||||
@deposit.amount = "12.00"
|
||||
assert_equal(BigDecimal.new("12.00"), @deposit.amount)
|
||||
assert_equal(BigDecimal("12.00"), @deposit.amount)
|
||||
|
||||
@deposit.amount = "12,11"
|
||||
assert_equal(BigDecimal.new("12.11"), @deposit.amount)
|
||||
assert_equal(BigDecimal("12.11"), @deposit.amount)
|
||||
end
|
||||
|
||||
def test_amount_is_converted_from_float
|
||||
@deposit.amount = 12.0044
|
||||
assert_equal(BigDecimal.new("12.0044"), @deposit.amount)
|
||||
assert_equal(BigDecimal("12.0044"), @deposit.amount)
|
||||
|
||||
@deposit.amount = 12.0144
|
||||
assert_equal(BigDecimal.new("12.0144"), @deposit.amount)
|
||||
assert_equal(BigDecimal("12.0144"), @deposit.amount)
|
||||
end
|
||||
|
||||
def test_amount_is_converted_from_nil
|
||||
@deposit.amount = nil
|
||||
assert_equal(BigDecimal.new("0.00"), @deposit.amount)
|
||||
assert_equal(BigDecimal("0.00"), @deposit.amount)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,16 +5,38 @@ class DirectoTest < ActiveSupport::TestCase
|
|||
@invoice = invoices(:one)
|
||||
end
|
||||
|
||||
def test_monthly_invoices_max_range_raises_if_overlaps
|
||||
|
||||
Setting.directo_monthly_number_max = Setting.directo_monthly_number_last.to_i + Registrar.count - 1
|
||||
error_message = 'Directo counter is out of period (max allowed number is smaller than last '\
|
||||
'counternumber plus Registrar\'s count)'
|
||||
|
||||
error = assert_raises RuntimeError do
|
||||
Directo.send_monthly_invoices
|
||||
end
|
||||
|
||||
assert_equal error_message, error.message
|
||||
end
|
||||
|
||||
def test_xml_is_include_transaction_date
|
||||
@invoice.update(total: @invoice.account_activity.bank_transaction.sum)
|
||||
@invoice.account_activity.bank_transaction.update(paid_at: Time.zone.now)
|
||||
|
||||
response = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<results>
|
||||
<Result Type="0" Desc="OK" docid="1" doctype="ARVE" submit="Invoices"/>
|
||||
</results>
|
||||
XML
|
||||
|
||||
stub_request(:post, ENV['directo_invoice_url']).with do |request|
|
||||
request.body.include? 'TransactionDate'
|
||||
end
|
||||
end.to_return(status: 200, body: response)
|
||||
|
||||
assert_nothing_raised do
|
||||
Directo.send_receipts
|
||||
end
|
||||
|
||||
assert_not_empty @invoice.directo_records.first.request
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,6 +13,8 @@ class AuctionDoubleTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
class DNS::DomainNameTest < ActiveSupport::TestCase
|
||||
fixtures 'whois/records'
|
||||
|
||||
def test_available_when_not_at_auction
|
||||
domain_name = DNS::DomainName.new('auction.test')
|
||||
auctions(:one).update!(domain: 'auction.test', status: Auction.statuses[:domain_registered])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue