Skip to content

Commit

Permalink
Merge pull request #322 from pulibrary/import_arks_round_2
Browse files Browse the repository at this point in the history
Import Arks.
  • Loading branch information
jrgriffiniii committed Oct 5, 2017
2 parents a2d05f6 + 50141b8 commit 5517e97
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/services/plum_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ def attributes
depositor: solr_doc["depositor_ssim"],
source_metadata_identifier: solr_doc.fetch("source_metadata_identifier_ssim", []).first,
title: solr_doc["title_tesim"],
state: solr_doc["workflow_state_name_ssim"]
state: solr_doc["workflow_state_name_ssim"],
identifier: solr_doc.fetch("identifier_tesim", []).first
}
end

Expand Down
3 changes: 3 additions & 0 deletions spec/fixtures/files/plum/ps7529f137.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"hasRelatedMediaFragment_ssim":[
"p7w62j794r"
],
"identifier_tesim":[
"ark:/88435/sx61dp92j"
],
"hasRelatedImage_ssim":[
"p7w62j794r"
],
Expand Down
1 change: 1 addition & 0 deletions spec/services/plum_importer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
expect(output.member_ids.length).to eq 2
expect(output.local_identifier).to eq ["ps7529f137"]
expect(output.member_of_collection_ids.length).to eq 2
expect(output.identifier).to eq ["ark:/88435/sx61dp92j"]

collections = query_service.find_references_by(resource: output, property: :member_of_collection_ids)
expect(collections.flat_map(&:slug)).to contain_exactly "cotsen", "pudl0139"
Expand Down

0 comments on commit 5517e97

Please sign in to comment.