diff --git a/app/importers/curate_mapper.rb b/app/importers/curate_mapper.rb index 6c498924..7e967447 100644 --- a/app/importers/curate_mapper.rb +++ b/app/importers/curate_mapper.rb @@ -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", @@ -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 @@ -65,7 +71,9 @@ def singular_fields "contact_information", "copyright_date", "date_created", + "date_digitized", "date_issued", + "extent", "holding_repository", "local_call_number", "institution", @@ -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" diff --git a/spec/importers/curate_mapper_spec.rb b/spec/importers/curate_mapper_spec.rb index 259c5632..b0a1b085 100644 --- a/spec/importers/curate_mapper_spec.rb +++ b/spec/importers/curate_mapper_spec.rb @@ -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" @@ -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) @@ -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) @@ -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)