From 318bc1dae02dc2b68388953ed2a7254c9d3614e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Turbelin?= Date: Thu, 17 Apr 2025 21:29:23 +0200 Subject: [PATCH] Add tests --- spec/models/enterprise_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/models/enterprise_spec.rb b/spec/models/enterprise_spec.rb index 1d05f99bd6..f553c518d0 100644 --- a/spec/models/enterprise_spec.rb +++ b/spec/models/enterprise_spec.rb @@ -415,6 +415,18 @@ RSpec.describe Enterprise do expect(e).not_to be_valid end end + + describe "external_billing_id" do + it "validates the external_billing_id attribute" do + e = build(:enterprise, external_billing_id: '123456') + expect(e).to be_valid + end + + it "does not validate the external_billing_id attribute with spaces" do + e = build(:enterprise, external_billing_id: '123 456') + expect(e).not_to be_valid + end + end end describe "serialisation" do