mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
Convert specs to tests
This commit is contained in:
parent
61b6df197e
commit
93b0037c39
6 changed files with 48 additions and 60 deletions
|
@ -1,9 +1,23 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistrarTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@registrar = registrars(:valid)
|
||||
end
|
||||
|
||||
def test_valid
|
||||
assert @registrar.valid?
|
||||
end
|
||||
|
||||
def test_rejects_absent_accounting_customer_code
|
||||
registrar = Registrar.new(accounting_customer_code: nil)
|
||||
registrar.validate
|
||||
assert registrar.errors.added?(:accounting_customer_code, :blank)
|
||||
@registrar.accounting_customer_code = nil
|
||||
@registrar.validate
|
||||
assert @registrar.invalid?
|
||||
end
|
||||
|
||||
def test_requires_country_code
|
||||
@registrar.country_code = nil
|
||||
@registrar.validate
|
||||
assert @registrar.invalid?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue