Require registrar's accounting customer code

#343
This commit is contained in:
Artur Beljajev 2017-10-27 11:56:54 +03:00
parent 579da84c58
commit 59e1e18d32
8 changed files with 29 additions and 2 deletions

View file

@ -13,6 +13,7 @@ class NewRegistrarTest < ActionDispatch::IntegrationTest
fill_in 'registrar[reg_no]', with: '1234567'
fill_in 'registrar[email]', with: 'test@test.com'
fill_in 'registrar[code]', with: 'test'
fill_in 'registrar[accounting_customer_code]', with: 'test'
click_link_or_button 'Create registrar'
assert_text 'Registrar has been successfully created'

View file

@ -0,0 +1,9 @@
require 'test_helper'
class RegistrarTest < ActiveSupport::TestCase
def test_rejects_absent_accounting_customer_code
registrar = Registrar.new(accounting_customer_code: nil)
registrar.validate
assert registrar.errors.added?(:accounting_customer_code, :blank)
end
end