mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
Add basic system test
This commit is contained in:
parent
a954f3c8e6
commit
3198538556
2 changed files with 24 additions and 1 deletions
|
@ -5,7 +5,7 @@
|
|||
<div class="col-md-2 control-label">
|
||||
<%= f.label :current_balance, t('.current_balance') %>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-4" id='registrar_balance'>
|
||||
<%= number_to_currency current_registrar_user.registrar.balance %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
require 'application_system_test_case'
|
||||
|
||||
class RegistrarDomainsTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@registrar = users(:api_bestnames).registrar
|
||||
@price = billing_prices(:renew_one_year)
|
||||
end
|
||||
|
||||
def test_downloads_domain_list_as_csv
|
||||
sign_in users(:api_bestnames)
|
||||
travel_to Time.zone.parse('2010-07-05 10:30')
|
||||
|
@ -18,4 +23,22 @@ class RegistrarDomainsTest < ApplicationSystemTestCase
|
|||
assert_equal "attachment; filename=\"Domains_2010-07-05_10.30.csv\"; filename*=UTF-8''Domains_2010-07-05_10.30.csv", response_headers['Content-Disposition']
|
||||
assert_equal expected_csv, page.body
|
||||
end
|
||||
|
||||
def test_mass_renewal
|
||||
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')
|
||||
assert_text 'Current balance'
|
||||
page.has_css?('#registrar_balance', text:
|
||||
ApplicationController.helpers.number_to_currency(@registrar.balance))
|
||||
|
||||
select '1 year', from: 'Period'
|
||||
click_button 'Filter'
|
||||
|
||||
@registrar.domains.pluck(:name).each do |domain_name|
|
||||
assert_text domain_name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue