mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 21:46:24 +02:00
updated tests
This commit is contained in:
parent
ac3244466e
commit
cda56c735f
5 changed files with 0 additions and 24 deletions
|
@ -12,8 +12,6 @@ class AddDepositsTest < ApplicationSystemTestCase
|
||||||
|
|
||||||
def test_should_send_request_for_creating_invoice_to_eis_system
|
def test_should_send_request_for_creating_invoice_to_eis_system
|
||||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
||||||
Spy.on_instance_method(EisBilling::GetInvoiceLink, :send_request).and_return(eis_response)
|
|
||||||
|
|
||||||
Spy.on_instance_method(EisBilling::AddDeposits, :send_invoice).and_return(eis_response)
|
Spy.on_instance_method(EisBilling::AddDeposits, :send_invoice).and_return(eis_response)
|
||||||
|
|
||||||
visit new_registrar_deposit_url
|
visit new_registrar_deposit_url
|
||||||
|
|
|
@ -7,8 +7,6 @@ class BalanceTopUpTest < ApplicationSystemTestCase
|
||||||
|
|
||||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
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::AddDeposits, :send_invoice).and_return(eis_response)
|
||||||
Spy.on_instance_method(EisBilling::GetInvoiceLink, :send_request).and_return(eis_response)
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
teardown do
|
teardown do
|
||||||
|
|
|
@ -5,7 +5,6 @@ class NewInvoicePaymentTest < ApplicationSystemTestCase
|
||||||
super
|
super
|
||||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
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::AddDeposits, :send_invoice).and_return(eis_response)
|
||||||
Spy.on_instance_method(EisBilling::GetInvoiceLink, :send_request).and_return(eis_response)
|
|
||||||
|
|
||||||
@original_vat_prc = Setting.registry_vat_prc
|
@original_vat_prc = Setting.registry_vat_prc
|
||||||
Setting.registry_vat_prc = 0.2
|
Setting.registry_vat_prc = 0.2
|
||||||
|
|
|
@ -9,7 +9,6 @@ class NewInvoiceTest < ApplicationSystemTestCase
|
||||||
|
|
||||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
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::AddDeposits, :send_invoice).and_return(eis_response)
|
||||||
Spy.on_instance_method(EisBilling::GetInvoiceLink, :send_request).and_return(eis_response)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_show_balance
|
def test_show_balance
|
||||||
|
|
|
@ -13,9 +13,6 @@ class RegistrarAreaInvoicesTest < ApplicationSystemTestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_cancels_an_invoice
|
def test_cancels_an_invoice
|
||||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
|
||||||
Spy.on_instance_method(EisBilling::GetInvoiceLink, :send_request).and_return(eis_response)
|
|
||||||
|
|
||||||
@invoice.account_activity = nil
|
@invoice.account_activity = nil
|
||||||
assert @invoice.cancellable?
|
assert @invoice.cancellable?
|
||||||
|
|
||||||
|
@ -28,18 +25,12 @@ class RegistrarAreaInvoicesTest < ApplicationSystemTestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_invoice_delivery_form_is_pre_populated_with_billing_email_of_a_registrar
|
def test_invoice_delivery_form_is_pre_populated_with_billing_email_of_a_registrar
|
||||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
|
||||||
Spy.on_instance_method(EisBilling::GetInvoiceLink, :send_request).and_return(eis_response)
|
|
||||||
|
|
||||||
assert_equal 'billing@bestnames.test', @invoice.buyer.billing_email
|
assert_equal 'billing@bestnames.test', @invoice.buyer.billing_email
|
||||||
visit new_registrar_invoice_delivery_url(@invoice)
|
visit new_registrar_invoice_delivery_url(@invoice)
|
||||||
assert_field 'Recipient', with: 'billing@bestnames.test'
|
assert_field 'Recipient', with: 'billing@bestnames.test'
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_delivers_an_invoice
|
def test_delivers_an_invoice
|
||||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
|
||||||
Spy.on_instance_method(EisBilling::GetInvoiceLink, :send_request).and_return(eis_response)
|
|
||||||
|
|
||||||
visit registrar_invoice_url(@invoice)
|
visit registrar_invoice_url(@invoice)
|
||||||
click_on 'Send'
|
click_on 'Send'
|
||||||
fill_in 'Recipient', with: 'billing@registrar.test'
|
fill_in 'Recipient', with: 'billing@registrar.test'
|
||||||
|
@ -53,9 +44,6 @@ class RegistrarAreaInvoicesTest < ApplicationSystemTestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_if_invoice_unpaid_should_be_present_everypay_link
|
def test_if_invoice_unpaid_should_be_present_everypay_link
|
||||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
|
||||||
Spy.on_instance_method(EisBilling::GetInvoiceLink, :send_request).and_return(eis_response)
|
|
||||||
|
|
||||||
invoice = invoices(:unpaid)
|
invoice = invoices(:unpaid)
|
||||||
visit registrar_invoice_url(invoice)
|
visit registrar_invoice_url(invoice)
|
||||||
|
|
||||||
|
@ -63,9 +51,6 @@ class RegistrarAreaInvoicesTest < ApplicationSystemTestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_if_invoice_unpaid_and_not_generated_link_comes_then_should_render_no_everypay_link
|
def test_if_invoice_unpaid_and_not_generated_link_comes_then_should_render_no_everypay_link
|
||||||
eis_response = OpenStruct.new(body: "{\"error\":\"Invoice not found\", \"status\":\"no_found\"}")
|
|
||||||
Spy.on_instance_method(EisBilling::GetInvoiceLink, :send_request).and_return(eis_response)
|
|
||||||
|
|
||||||
invoice = invoices(:unpaid)
|
invoice = invoices(:unpaid)
|
||||||
visit registrar_invoice_url(invoice)
|
visit registrar_invoice_url(invoice)
|
||||||
|
|
||||||
|
@ -73,9 +58,6 @@ class RegistrarAreaInvoicesTest < ApplicationSystemTestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_if_invoice_aldready_paid_there_should_not_any_everypay_link
|
def test_if_invoice_aldready_paid_there_should_not_any_everypay_link
|
||||||
eis_response = OpenStruct.new(body: "{\"payment_link\":\"http://link.test\"}")
|
|
||||||
Spy.on_instance_method(EisBilling::GetInvoiceLink, :send_request).and_return(eis_response)
|
|
||||||
|
|
||||||
visit registrar_invoice_url(@invoice)
|
visit registrar_invoice_url(@invoice)
|
||||||
|
|
||||||
assert_no_text 'No everypay link'
|
assert_no_text 'No everypay link'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue