mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Add configurable minimum deposit #2782
This commit is contained in:
parent
e92ef92331
commit
1fe8bd3f46
6 changed files with 31 additions and 1 deletions
|
@ -41,6 +41,27 @@ feature 'Invoice', type: :feature do
|
|||
page.should have_content(r.name)
|
||||
end
|
||||
|
||||
it 'should not issue and invoice with deposit amount too small' do
|
||||
Setting.minimum_deposit = 0.0
|
||||
r = Fabricate(:registrar)
|
||||
visit admin_invoices_url
|
||||
click_link('Add')
|
||||
select r.name, from: 'Registrar'
|
||||
fill_in 'Amount', with: '-2.11'
|
||||
fill_in 'Description', with: 'test issue'
|
||||
click_button 'Save'
|
||||
page.should have_content('Amount is too small. Minimum deposit is 0.0 EUR')
|
||||
Setting.minimum_deposit = 12.43
|
||||
fill_in 'Amount', with: '12.42'
|
||||
click_button 'Save'
|
||||
|
||||
page.should have_content('Amount is too small. Minimum deposit is 12.43 EUR')
|
||||
fill_in 'Amount', with: '12.44'
|
||||
click_button 'Save'
|
||||
page.should have_content('Record created')
|
||||
Setting.minimum_deposit = 0.0
|
||||
end
|
||||
|
||||
it 'should forward invoice' do
|
||||
visit '/admin/invoices'
|
||||
click_link @invoice.to_s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue