Skip to content

Commit

Permalink
Import genre from CSV file. Story #98 (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
val99erie authored and bess committed Sep 19, 2018
1 parent db9bb5a commit 89a96a0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/importers/californica_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class CalifornicaMapper < Darlingtonia::HashMapper
date_created: "Date.creation",
caption: "Description.caption",
dimensions: "Format.dimensions",
funding_note: "Description.fundingNote"
funding_note: "Description.fundingNote",
genre: "Type.genre"
}.freeze

DELIMITER = '|~|'
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/example.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"Item Ark","Alternate Identifier.local","Title","Subject","Type.typeOfResource","Publisher.publisherName","Format.medium","Name.repository","Description.note","Format.extent","Project Name","Description.latitude","Description.longitude","Date.creation","Description.caption","Format.dimensions","Description.fundingNote"
"21198/zz0002nq4w","uclalat_1387_b107_40098","Protesters with signs in gallery of Los Angeles County Supervisors hearing over eminent domain for construction of Harbor Freeway, Calif., 1947","Express highways--California--Los Angeles County--Design and construction|~|Eminent domain--California--Los Angeles|~|Demonstrations--California--Los Angeles County|~|Transportation|~|Government|~|Activism|~|Interstate 10","still image","Los Angeles Daily News","1 photograph","University of California, Los Angeles. $b Library Special Collections","At the Hall of Records, 220 N. Broadway.|~|Description 2","1 photo","Los Angeles Daily News Negatives","34.054133","-118.243865","September 17, 1947","This example does not have a caption.","10 x 12.5 cm.","Info about funding"
"Item Ark","Alternate Identifier.local","Title","Subject","Type.typeOfResource","Publisher.publisherName","Format.medium","Name.repository","Description.note","Format.extent","Project Name","Description.latitude","Description.longitude","Date.creation","Description.caption","Format.dimensions","Description.fundingNote","Type.genre"
"21198/zz0002nq4w","uclalat_1387_b107_40098","Protesters with signs in gallery of Los Angeles County Supervisors hearing over eminent domain for construction of Harbor Freeway, Calif., 1947","Express highways--California--Los Angeles County--Design and construction|~|Eminent domain--California--Los Angeles|~|Demonstrations--California--Los Angeles County|~|Transportation|~|Government|~|Activism|~|Interstate 10","still image","Los Angeles Daily News","1 photograph","University of California, Los Angeles. $b Library Special Collections","At the Hall of Records, 220 N. Broadway.|~|Description 2","1 photo","Los Angeles Daily News Negatives","34.054133","-118.243865","September 17, 1947","This example does not have a caption.","10 x 12.5 cm.","Info about funding","news photographs"
2 changes: 1 addition & 1 deletion spec/importers/californica_mapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
:resource_type, :description, :latitude,
:longitude, :extent, :local_identifier,
:date_created, :caption, :dimensions,
:funding_note
:funding_note, :genre
)
end
end
Expand Down
1 change: 1 addition & 0 deletions spec/tasks/ingest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def loaded_files_excluding_current_rake_file
expect(created_work.caption).to eq ['This example does not have a caption.']
expect(created_work.dimensions).to eq ['10 x 12.5 cm.']
expect(created_work.funding_note).to eq ['Info about funding']
expect(created_work.genre).to eq ['news photographs']
end

it 'has created a public work' do
Expand Down

0 comments on commit 89a96a0

Please sign in to comment.