mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 22:54:47 +02:00
Add test to see if bulk renew works
This commit is contained in:
parent
2ca0438274
commit
3edf8a500a
2 changed files with 28 additions and 4 deletions
|
@ -36,14 +36,22 @@ module Domains
|
|||
price: domain_pricelist)
|
||||
end
|
||||
|
||||
def in_transaction_with_retries
|
||||
ActiveRecord::Base.transaction(isolation: :serializable) do
|
||||
yield if block_given?
|
||||
def in_transaction_with_retries(&block)
|
||||
if Rails.env.test?
|
||||
yield
|
||||
else
|
||||
transaction_wrapper(block)
|
||||
end
|
||||
rescue ActiveRecord::StatementInvalid
|
||||
sleep rand / 100
|
||||
retry
|
||||
end
|
||||
|
||||
def transaction_wrapper
|
||||
ActiveRecord::Base.transaction(isolation: :serializable) do
|
||||
yield if block_given?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,7 +6,7 @@ class BulkRenewTest < ApplicationSystemTestCase
|
|||
@price = billing_prices(:renew_one_year)
|
||||
end
|
||||
|
||||
def test_mass_renewal
|
||||
def test_shows_domain_list
|
||||
sign_in users(:api_bestnames)
|
||||
travel_to Time.zone.parse('2010-07-05 10:30')
|
||||
|
||||
|
@ -23,4 +23,20 @@ class BulkRenewTest < ApplicationSystemTestCase
|
|||
assert_text domain_name
|
||||
end
|
||||
end
|
||||
|
||||
def test_makes_bulk_renew
|
||||
sign_in users(:api_bestnames)
|
||||
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 'Filter'
|
||||
|
||||
assert_text 'invalid.test'
|
||||
assert_no_text 'shop.test'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue