|
106 | 106 |
|
107 | 107 | it 'can reingest child objects and keep oids, captions and labels but replace image source location' do |
108 | 108 | allow(S3Service).to receive(:s3_exists?).and_return(false) |
109 | | - expect(ParentObject.count).to eq 1 |
110 | | - expect(ChildObject.count).to eq 3 |
111 | | - po_first = ParentObject.first |
112 | | - co_first = ChildObject.first |
113 | | - expect(co_first.oid).to eq 1_002_533 |
114 | | - expect(co_first.caption).to eq 'original first caption' |
115 | | - expect(co_first.label).to eq 'original first label' |
116 | | - expect(co_first.checksum).to eq 'c314697a5b0fd444e26e7c12a1d8d487545dacfc' |
117 | | - expect(po_first.last_preservica_update).to be nil |
| 109 | + expect(aspace_parent.child_objects.count).to eq 3 |
| 110 | + expect(co_1.oid).to eq 1_002_533 |
| 111 | + expect(co_1.caption).to eq 'original first caption' |
| 112 | + expect(co_1.label).to eq 'original first label' |
| 113 | + expect(co_1.checksum).to eq 'c314697a5b0fd444e26e7c12a1d8d487545dacfc' |
| 114 | + expect(aspace_parent.last_preservica_update).to be nil |
118 | 115 | expect(ptf_1.access_primary_path).to eq "spec/fixtures/images/access_primaries/03/33/10/02/53/1002533.tif" |
119 | 116 | expect(ptf_2.access_primary_path).to eq "spec/fixtures/images/access_primaries/03/34/10/02/53/1002534.tif" |
120 | 117 | expect(ptf_3.access_primary_path).to eq "spec/fixtures/images/access_primaries/03/35/10/02/53/1002535.tif" |
|
124 | 121 | reingest_batch_process.file = preservica_reingest |
125 | 122 | reingest_batch_process.save! |
126 | 123 | end.not_to change { ChildObject.count } |
127 | | - po_first = ParentObject.first |
128 | | - co_first = ChildObject.first |
129 | | - co_second = ChildObject.all[1] |
130 | | - co_third = ChildObject.last |
| 124 | + aspace_parent.reload |
| 125 | + co_first = co_1.reload |
| 126 | + co_second = co_2.reload |
| 127 | + co_third = co_3.reload |
131 | 128 |
|
132 | | - expect(po_first.last_preservica_update).not_to be nil |
| 129 | + expect(aspace_parent.last_preservica_update).not_to be nil |
133 | 130 | expect(co_first.last_preservica_update).not_to be nil |
134 | 131 | expect(co_first.sha512_checksum).to eq '1932c08c4670d5010fac6fa363ad5d9be7a4e7d743757ba5eefbbe8e3f9b2fb89b1604c1e527cfae6f47a91a60845268e91d2723aa63a90dd4735f75017569f7' |
135 | 132 | expect(co_first.oid).to eq 1_002_533 |
|
0 commit comments