From e0681eff6305be9cf99cec20d20a77b2c7e16918 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 30 Nov 2018 16:42:50 +0200 Subject: [PATCH] Add fixture --- test/fixtures/registrars.yml | 11 +++++++++++ test/models/registrar_test.rb | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/test/fixtures/registrars.yml b/test/fixtures/registrars.yml index e2d6dfc13..be7adaa5b 100644 --- a/test/fixtures/registrars.yml +++ b/test/fixtures/registrars.yml @@ -35,3 +35,14 @@ not_in_use: accounting_customer_code: any language: en reference_no: 39 + +invalid: + name: "" + reg_no: any + code: another + email: any + country_code: US + vat_no: any + accounting_customer_code: any + language: en + reference_no: 42 diff --git a/test/models/registrar_test.rb b/test/models/registrar_test.rb index bc50e4071..05314b747 100644 --- a/test/models/registrar_test.rb +++ b/test/models/registrar_test.rb @@ -9,6 +9,10 @@ class RegistrarTest < ActiveSupport::TestCase assert @registrar.valid?, proc { @registrar.errors.full_messages } end + def test_invalid_fixture_is_invalid + assert registrars(:invalid).invalid? + end + def test_invalid_without_name @registrar.name = '' assert @registrar.invalid?