Merge branch 'master' into registry-623

# Conflicts:
#	app/controllers/admin/registrars_controller.rb
#	app/models/registrar.rb
#	app/views/admin/registrars/_billing.html.erb
#	app/views/admin/registrars/show.html.erb
#	config/locales/admin/registrars.en.yml
#	config/locales/en.yml
#	db/migrate/20180309053424_add_registrars_unique_constraints.rb
#	db/structure.sql
#	test/fixtures/registrars.yml
#	test/integration/admin/registrars/delete_test.rb
#	test/integration/admin/registrars/new_test.rb
#	test/models/registrar_test.rb
This commit is contained in:
Artur Beljajev 2018-03-29 12:09:13 +03:00
commit 837f326ef6
37 changed files with 232 additions and 245 deletions

View file

@ -5,7 +5,7 @@ class AdminAreaDeleteRegistrarTest < ActionDispatch::IntegrationTest
login_as users(:admin)
end
def test_can_be_deleted_if_not_in_use
def test_can_be_deleted_when_not_in_use
visit admin_registrar_url(registrars(:not_in_use))
assert_difference 'Registrar.count', -1 do
@ -15,4 +15,16 @@ class AdminAreaDeleteRegistrarTest < ActionDispatch::IntegrationTest
assert_current_path admin_registrars_path
assert_text 'Registrar has been successfully deleted'
end
def test_cannot_be_deleted_when_in_use
registrar = registrars(:bestnames)
visit admin_registrar_url(registrar)
assert_no_difference 'Registrar.count' do
click_link_or_button 'Delete'
end
assert_current_path admin_registrar_path(registrar)
assert_text 'Cannot delete record because dependent domains exist'
end
end

View file

@ -9,10 +9,9 @@ class AdminAreaNewRegistrarTest < ActionDispatch::IntegrationTest
visit admin_registrars_url
click_link_or_button 'New registrar'
fill_in 'Name', with: 'Brand new name'
fill_in 'Name', with: 'Brand new names'
fill_in 'Reg no', with: '55555555'
fill_in 'Contact e-mail', with: 'test@example.com'
select 'United States', from: 'Country'
fill_in 'Accounting customer code', with: 'test'
fill_in 'Code', with: 'test'