Convert specs to tests

#343
This commit is contained in:
Artur Beljajev 2017-10-27 10:24:57 +03:00
parent 36db8598d2
commit 579da84c58
6 changed files with 82 additions and 59 deletions

View file

@ -0,0 +1,17 @@
require 'test_helper'
class EditRegistrarTest < ActionDispatch::IntegrationTest
def setup
login_as create(:admin_user)
end
def test_updates_registrar
registrar = create(:registrar)
visit admin_registrar_path(registrar)
click_link_or_button 'Edit'
click_link_or_button 'Update registrar'
assert_text 'Registrar has been successfully updated'
end
end

View file

@ -0,0 +1,20 @@
require 'test_helper'
class NewRegistrarTest < ActionDispatch::IntegrationTest
def setup
login_as create(:admin_user)
end
def test_creates_registrar
visit admin_registrars_path
click_link_or_button 'New registrar'
fill_in 'registrar[name]', with: 'test'
fill_in 'registrar[reg_no]', with: '1234567'
fill_in 'registrar[email]', with: 'test@test.com'
fill_in 'registrar[code]', with: 'test'
click_link_or_button 'Create registrar'
assert_text 'Registrar has been successfully created'
end
end