mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Add test & error message if not enough funds for renew
This commit is contained in:
parent
95a789ab60
commit
13455b398c
3 changed files with 17 additions and 0 deletions
|
@ -42,6 +42,7 @@ module Domains
|
|||
|
||||
def manage_errors(task)
|
||||
errors.merge!(task.errors) unless task.valid?
|
||||
errors.add(:domain, I18n.t('not_enough_funds')) unless task.result
|
||||
end
|
||||
|
||||
def run_task(domain)
|
||||
|
|
|
@ -590,6 +590,7 @@ en:
|
|||
billing_failure_credit_balance_low: 'Billing failure - credit balance low'
|
||||
billing_failure_credit_balance_low_for_domain: 'Billing failure - credit balance low for %{domain}'
|
||||
domain_renew_error_for_domain: 'Domain renew error for %{domain}'
|
||||
not_enough_funds: 'Not enough funds for renew domains'
|
||||
create: 'Create'
|
||||
activity_type: 'Activity type'
|
||||
receipt_date_from: 'Receipt date from'
|
||||
|
|
|
@ -37,4 +37,19 @@ class BulkRenewTest < ApplicationSystemTestCase
|
|||
assert_text 'invalid.test'
|
||||
assert_no_text 'shop.test'
|
||||
end
|
||||
|
||||
def test_bulk_renew_checks_balance
|
||||
sign_in users(:api_bestnames)
|
||||
@price.update(price_cents: 99999999)
|
||||
travel_to Time.zone.parse('2010-07-05 10:30')
|
||||
|
||||
visit new_registrar_bulk_change_url
|
||||
click_link('Bulk renew')
|
||||
select '1 year', from: 'Period'
|
||||
click_button 'Filter'
|
||||
click_button 'Renew'
|
||||
|
||||
assert_text 'Not enough funds for renew domains'
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue