Merge pull request #2433 from internetee/remove-feature-toggle

remove eis-billing feature toggle
This commit is contained in:
Timo Võhmar 2022-09-13 14:58:10 +03:00 committed by GitHub
commit f77883b266
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 459 additions and 583 deletions

View file

@ -58,39 +58,37 @@ class AdminAreaBankStatementTest < ApplicationSystemTestCase
end
def test_can_bind_statement_transactions
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: {})
registrar = registrars(:bestnames)
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: {})
registrar = registrars(:bestnames)
stub_request(:post, "https://eis_billing_system:3000/api/v1/invoice_generator/invoice_generator")
.to_return(status: 200, body: "{\"everypay_link\":\"http://link.test\"}", headers: {})
stub_request(:post, "https://eis_billing_system:3000/api/v1/invoice_generator/invoice_generator")
.to_return(status: 200, body: "{\"everypay_link\":\"http://link.test\"}", 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(: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: {})
stub_request(:post, "https://eis_billing_system:3000/api/v1/e_invoice/e_invoice")
.to_return(status: 200, body: "", headers: {})
registrar.issue_prepayment_invoice(500)
invoice = registrar.invoices.last
registrar.issue_prepayment_invoice(500)
invoice = registrar.invoices.last
create_bank_statement
click_link_or_button 'Add'
assert_text 'Create bank transaction'
create_bank_statement
click_link_or_button 'Add'
assert_text 'Create bank transaction'
fill_in 'Description', with: "Invoice with id #{invoice.number}"
fill_in 'Reference number', with: invoice.reference_no
fill_in 'Sum', with: invoice.total
fill_in 'Paid at', with: Time.zone.today.to_s
click_link_or_button 'Save'
fill_in 'Description', with: "Invoice with id #{invoice.number}"
fill_in 'Reference number', with: invoice.reference_no
fill_in 'Sum', with: invoice.total
fill_in 'Paid at', with: Time.zone.today.to_s
click_link_or_button 'Save'
click_link_or_button 'Back to bank statement'
click_link_or_button 'Bind invoices'
click_link_or_button 'Back to bank statement'
click_link_or_button 'Bind invoices'
assert_text 'Invoices were fully binded'
end
assert_text 'Invoices were fully binded'
end
def create_bank_statement

View file

@ -14,30 +14,28 @@ class AdminRegistrarsSystemTest < ApplicationSystemTestCase
end
def test_creates_new_registrar
if Feature.billing_system_integrated?
stub_request(:post, "https://eis_billing_system:3000/api/v1/invoice_generator/reference_number_generator").
to_return(status: 200, body: "{\"reference_number\":\"12332\"}", headers: {})
stub_request(:post, "https://eis_billing_system:3000/api/v1/invoice_generator/reference_number_generator").
to_return(status: 200, body: "{\"reference_number\":\"12332\"}", headers: {})
assert_nil Registrar.find_by(name: 'Acme Ltd')
assert_nil Registrar.find_by(name: 'Acme Ltd')
visit admin_registrars_path
click_on 'New registrar'
visit admin_registrars_path
click_on 'New registrar'
fill_in 'Name', with: 'Acme Ltd'
fill_in 'Reg no', with: '1234'
fill_in 'Contact e-mail', with: 'any@acme.test'
fill_in 'Street', with: 'any'
fill_in 'City', with: 'any'
fill_in 'State / Province', with: 'any'
fill_in 'Zip', with: 'any'
select 'United States', from: 'Country'
fill_in 'Accounting customer code', with: 'test'
fill_in 'Code', with: 'test'
click_on 'Create registrar'
fill_in 'Name', with: 'Acme Ltd'
fill_in 'Reg no', with: '1234'
fill_in 'Contact e-mail', with: 'any@acme.test'
fill_in 'Street', with: 'any'
fill_in 'City', with: 'any'
fill_in 'State / Province', with: 'any'
fill_in 'Zip', with: 'any'
select 'United States', from: 'Country'
fill_in 'Accounting customer code', with: 'test'
fill_in 'Code', with: 'test'
click_on 'Create registrar'
assert_text 'Registrar has been successfully created'
assert_text 'Acme Ltd'
end
assert_text 'Registrar has been successfully created'
assert_text 'Acme Ltd'
end
def test_updates_registrar