From 47a8f9a950ee3a15a2a3b4fb42d9693c657d531f Mon Sep 17 00:00:00 2001 From: Erica Titkemeyer Date: Mon, 9 Dec 2024 16:49:06 -0500 Subject: [PATCH] adds allowance for no PI format --- spec/models/physical_instantiation_spec.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/models/physical_instantiation_spec.rb b/spec/models/physical_instantiation_spec.rb index eb49dc83f..753bfde9d 100644 --- a/spec/models/physical_instantiation_spec.rb +++ b/spec/models/physical_instantiation_spec.rb @@ -45,7 +45,12 @@ expect(physical_instantiation.resource.dump(:ttl)).to match(/ebucore#hasFormat/) expect(physical_instantiation.format.include?("Test format")).to be true end - end + it "handles absence of format gracefully" do + physical_instantiation.format = nil + expect(physical_instantiation.resource.dump(:ttl)).not_to match(/ebucore#hasFormat/) + expect(physical_instantiation.format).to be_nil + end + end context "standard" do let(:physical_instantiation) { FactoryBot.build(:physical_instantiation) }