|
13 | 13 | )
|
14 | 14 | end
|
15 | 15 |
|
16 |
| - let(:legacy_parent_ids_doc) do |
17 |
| - SolrDocument.new( |
18 |
| - parent_ssim: %w[abc123 def ghi], |
19 |
| - parent_unittitles_ssm: %w[ABC123 DEF GHI], |
20 |
| - ead_ssi: 'abc123', |
21 |
| - _root_: 'abc123', |
22 |
| - parent_levels_ssm: %w[collection] |
23 |
| - ) |
24 |
| - end |
25 |
| - |
26 | 16 | let(:dot_eadid_doc) do
|
27 | 17 | SolrDocument.new(
|
28 | 18 | parent_ids_ssim: %w[abc123-xml abc123-xml_def abc123-xml_ghi],
|
|
35 | 25 | let(:empty_document) { SolrDocument.new }
|
36 | 26 | let(:good_instance) { described_class.from_solr_document(document) }
|
37 | 27 | let(:dot_eadid_instance) { described_class.from_solr_document(dot_eadid_doc) }
|
38 |
| - let(:legacy_parent_ids_instance) { described_class.from_solr_document(legacy_parent_ids_doc) } |
39 | 28 |
|
40 | 29 | describe '.from_solr_document' do
|
41 | 30 | context 'with good data' do
|
|
45 | 34 |
|
46 | 35 | it 'values are appropriately set' do
|
47 | 36 | expect(good_instance.ids).to eq %w[abc123 abc123_def abc123_ghi]
|
48 |
| - expect(good_instance.legacy_ids).to be_empty |
49 | 37 | expect(good_instance.labels).to eq %w[ABC123 DEF GHI]
|
50 | 38 | expect(good_instance.eadid).to eq 'abc123'
|
51 | 39 | expect(good_instance.levels).to eq %w[collection]
|
|
56 | 44 | end
|
57 | 45 | end
|
58 | 46 |
|
59 |
| - context 'with legacy parent_ssim data' do |
60 |
| - it 'id values are appropriately set' do |
61 |
| - expect(legacy_parent_ids_instance.ids).to be_empty |
62 |
| - expect(legacy_parent_ids_instance.legacy_ids).to eq %w[abc123 abc123def abc123ghi] |
63 |
| - end |
64 |
| - end |
65 |
| - |
66 | 47 | context 'with no data' do
|
67 | 48 | it 'returns an instance of itself' do
|
68 | 49 | expect(described_class.from_solr_document(empty_document)).to be_an described_class
|
|
92 | 73 | end
|
93 | 74 | end
|
94 | 75 |
|
95 |
| - context 'with legacy parent_ssim data' do |
96 |
| - it 'the containing parents have the correct data' do |
97 |
| - expect(legacy_parent_ids_instance.as_parents.first.id).to eq 'abc123' |
98 |
| - expect(legacy_parent_ids_instance.as_parents.last.id).to eq 'abc123ghi' |
99 |
| - end |
100 |
| - end |
101 |
| - |
102 | 76 | context 'with no data' do
|
103 | 77 | it 'returns an empty array' do
|
104 |
| - expect(described_class.new(ids: [], legacy_ids: [], labels: [], eadid: '', levels: '').as_parents).to eq [] |
| 78 | + expect(described_class.new(ids: [], labels: [], eadid: '', levels: '').as_parents).to eq [] |
105 | 79 | end
|
106 | 80 | end
|
107 | 81 | end
|
|
0 commit comments