Skip to content

Commit

Permalink
More string fields (#502)
Browse files Browse the repository at this point in the history
* Added sensitive_material

* Added extent

* Add sublocation

* Add date_digitized

* Transfer engineer
  • Loading branch information
bess authored Aug 21, 2019
1 parent fb949bc commit 3a1e8c0
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/importers/curate_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class CurateMapper < Zizia::HashMapper
creator: "creator",
data_classification: "data_classification",
date_created: "date_created",
date_digitized: "date_digitized",
date_issued: "date_issued",
extent: "extent",
holding_repository: "holding_repository",
institution: "institution",
internal_rights_note: "internal_rights_note",
Expand All @@ -29,11 +31,15 @@ class CurateMapper < Zizia::HashMapper
rights_holder: "rights_holder",
rights_statement: "rights_statement",
rights_statement_text: "rights_statement_text",
sensitive_material: "sensitive_material",
sensitive_material_note: "sensitive_material_note",
subject_geo: "subject_geo",
subject_names: "subject_names",
subject_topics: "subject_topics",
sublocation: "sublocation",
table_of_contents: "table_of_contents",
title: "title",
transfer_engineer: "transfer_engineer",
uniform_title: "uniform_title",
visibility: "visibility"
}.freeze
Expand Down Expand Up @@ -65,7 +71,9 @@ def singular_fields
"contact_information",
"copyright_date",
"date_created",
"date_digitized",
"date_issued",
"extent",
"holding_repository",
"local_call_number",
"institution",
Expand All @@ -74,6 +82,10 @@ def singular_fields
"place_of_production",
"primary_language",
"publisher",
"sensitive_material",
"sensitive_material_note",
"sublocation",
"transfer_engineer",
"rights_holder",
"table_of_contents",
"uniform_title"
Expand Down
72 changes: 72 additions & 0 deletions spec/importers/curate_mapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,36 @@
end
end

context "#date_digitized" do
let(:metadata) do
{
"title" => "my title",
"date_digitized" => "1985-11-01"
}
end
it "maps the date_digitized field" do
expect(mapper.date_digitized).to eq "1985-11-01"
end
end

context "#date_issued" do
it "maps the date_issued field" do
expect(mapper.date_issued).to eq "Unknown"
end
end

context "#extent" do
let(:metadata) do
{
"title" => "my title",
"extent" => "10.29 x 08.53 inches"
}
end
it "maps the extent field" do
expect(mapper.extent).to eq "10.29 x 08.53 inches"
end
end

context "#holding_repository" do
it "maps the holding_repository field" do
expect(mapper.holding_repository).to eq "Stuart A. Rose Manuscript, Archives and Rare Book Library"
Expand Down Expand Up @@ -247,6 +271,30 @@
end
end

context "#sensitive_material" do
let(:metadata) do
{
"title" => "my title",
"sensitive_material" => "No"
}
end
it "maps the sensitive_material field" do
expect(mapper.sensitive_material).to eq "No"
end
end

context "#sensitive_material_note" do
let(:metadata) do
{
"title" => "my title",
"sensitive_material_note" => "Be very careful with this sensitive material."
}
end
it "maps the sensitive_material_note field" do
expect(mapper.sensitive_material_note).to eq "Be very careful with this sensitive material."
end
end

context "#subject_geo" do
it "maps the subject_geo field" do
expect(mapper.subject_geo)
Expand All @@ -268,6 +316,18 @@
end
end

context "#sublocation" do
let(:metadata) do
{
"title" => "my title",
"sublocation" => "Box 1"
}
end
it "maps the sublocation field" do
expect(mapper.sublocation).to eq "Box 1"
end
end

context "#table_of_contents" do
it "maps the table_of_contents field" do
expect(mapper.table_of_contents)
Expand All @@ -282,6 +342,18 @@
end
end

context "#transfer_engineer" do
let(:metadata) do
{
"title" => "my title",
"transfer_engineer" => "Leroy Jenkins"
}
end
it "maps the transfer_engineer field" do
expect(mapper.transfer_engineer).to eq "Leroy Jenkins"
end
end

context "#uniform_title" do
it "maps the uniform_title field" do
expect(mapper.uniform_title)
Expand Down

0 comments on commit 3a1e8c0

Please sign in to comment.