Skip to content

Commit ca494f3

Browse files
committed
test: Verify this works with allinone caching
1 parent a00a7ec commit ca494f3

2 files changed

Lines changed: 5950 additions & 1 deletion

File tree

spec/collectionspace/mapper/dates/structured_date_handler_spec.rb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,36 @@
3636
expect(result).to eq(refname)
3737
end
3838
end
39+
40+
context "with single record type handler" do
41+
let(:handler) do
42+
setup_single_record_type_handler(
43+
profile: "anthro",
44+
mapper: "https://raw.githubusercontent.com/collectionspace/"\
45+
"cspace-config-untangler/refs/heads/main/data/mappers/"\
46+
"community_profiles/release_8_1_1/anthro/"\
47+
"anthro_9-0-0_collectionobject.json"
48+
)
49+
end
50+
51+
context "when term is cached" do
52+
let(:domain) { "c.anthro.collectionspace.org" }
53+
it "returns expected refname" do
54+
handler.cache
55+
.put_vocab_term("dateera", "CE", refname, "refname")
56+
expect(result).to eq(refname)
57+
end
58+
end
59+
60+
context "when term is not cached" do
61+
let(:domain) { "anthro.collectionspace.org" }
62+
it "returns expected refname" do
63+
%w[refname csid].each do |type|
64+
handler.cache.remove_vocab_term("dateera", "CE", type)
65+
end
66+
expect(result).to eq(refname)
67+
end
68+
end
69+
end
3970
end
4071
end

0 commit comments

Comments
 (0)