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,18 @@
require 'test_helper'
class RegistrarsControllerTest < ActionDispatch::IntegrationTest
def setup
login_as create(:admin_user)
end
def test_creates_new_registrar
assert_difference -> { Registrar.count } do
post admin_registrars_path, registrar: attributes_for(:registrar)
end
end
def test_redirects_to_newly_created_registrar
post admin_registrars_path, registrar: attributes_for(:registrar)
assert_redirected_to admin_registrar_path(Registrar.first)
end
end