From 0ff36bdd7e08ebe3a0edfd47268670e5ca37740f Mon Sep 17 00:00:00 2001 From: HassanAkbar Date: Wed, 15 May 2024 13:06:04 +0500 Subject: [PATCH] Adding status valid when missing in file --- lib/tc211/termbase/glossarist/concept.rb | 2 +- spec/tc211/termbase_spec.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/tc211/termbase/glossarist/concept.rb b/lib/tc211/termbase/glossarist/concept.rb index cda7e52..3cbc2be 100644 --- a/lib/tc211/termbase/glossarist/concept.rb +++ b/lib/tc211/termbase/glossarist/concept.rb @@ -24,7 +24,7 @@ def register_info { "dateAccepted" => date_accepted&.date&.dup, "id" => uuid, - "status" => entry_status, + "status" => entry_status || "valid", }.compact end end diff --git a/spec/tc211/termbase_spec.rb b/spec/tc211/termbase_spec.rb index 11dff6f..dfb4724 100644 --- a/spec/tc211/termbase_spec.rb +++ b/spec/tc211/termbase_spec.rb @@ -162,6 +162,22 @@ end end end + + context "concept 18" do + let(:concept) { collection.fetch("18") } + + it "should have 11 localized concepts" do + expect(concept.localized_concepts.count).to be(11) + end + + context "dan localization with status missing in file" do + let(:localized_concept) { concept.localization("dan") } + + it "should have status=valid" do + expect(localized_concept.status).to eq("valid") + end + end + end end end end