-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update headers for the downloadable CSV template (#43)
* Remove system fields that should not be used * Add a `files` header
- Loading branch information
Showing
3 changed files
with
21 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,21 +7,20 @@ | |
|
||
# Properties defined in Hyrax::CoreMetadata | ||
let(:core_fields) do | ||
[:depositor, :title, :date_modified] | ||
[:title] | ||
end | ||
|
||
# Properties defined in Hyrax::BasicMetadata | ||
let(:basic_fields) do | ||
[:label, :relative_path, :import_url, | ||
:resource_type, :creator, :contributor, | ||
[:resource_type, :creator, :contributor, | ||
:description, :keyword, :license, | ||
:rights_statement, :publisher, :date_created, | ||
:subject, :language, :identifier, :based_near, | ||
:related_url, :bibliographic_citation, :source] | ||
end | ||
|
||
let(:tenejo_fields) do | ||
[:visibility] | ||
[:visibility, :files] | ||
end | ||
|
||
it_behaves_like 'a Zizia::Mapper' do | ||
|
@@ -35,25 +34,20 @@ | |
context 'with metadata, but some missing fields' do | ||
before { mapper.metadata = metadata } | ||
let(:metadata) do | ||
{ 'depositor' => '[email protected]', | ||
'title' => 'A Title', | ||
{ 'title' => 'A Title', | ||
'language' => 'English' } | ||
end | ||
|
||
it 'provides methods for the fields, even fields that aren\'t included in the metadata' do | ||
expect(metadata).to include('title') | ||
expect(mapper).to respond_to(:title) | ||
|
||
expect(metadata).not_to include('label') | ||
expect(mapper).to respond_to(:label) | ||
expect(metadata).not_to include('source') | ||
expect(mapper).to respond_to(:source) | ||
end | ||
|
||
it 'returns single values for single-value fields' do | ||
expect(mapper.depositor).to eq '[email protected]' | ||
expect(mapper.date_modified).to eq nil | ||
expect(mapper.label).to eq nil | ||
expect(mapper.relative_path).to eq nil | ||
expect(mapper.import_url).to eq nil | ||
expect(mapper.visibility).to eq 'restricted' | ||
end | ||
|
||
it 'returns array values for multi-value fields' do | ||
|
@@ -91,12 +85,7 @@ | |
{ 'Title' => 'A Title', | ||
'Related URL' => 'http://example.com', | ||
'Abstract or Summary' => 'desc1|~|desc2', | ||
'visiBILITY' => 'open', | ||
'Depositor' => '[email protected]', | ||
'DATE_modified' => 'mod date', | ||
'laBel' => 'label', | ||
'relative_PATH' => 'rel path', | ||
'import_URL' => 'imp url' } | ||
'visiBILITY' => 'open' } | ||
end | ||
|
||
it 'matches the correct fields' do | ||
|
@@ -105,11 +94,6 @@ | |
expect(mapper.description).to eq ['desc1', 'desc2'] | ||
expect(mapper.creator).to eq [] | ||
expect(mapper.visibility).to eq 'open' | ||
expect(mapper.depositor).to eq '[email protected]' | ||
expect(mapper.date_modified).to eq 'mod date' | ||
expect(mapper.label).to eq 'label' | ||
expect(mapper.relative_path).to eq 'rel path' | ||
expect(mapper.import_url).to eq 'imp url' | ||
end | ||
end | ||
|
||
|
@@ -184,7 +168,7 @@ | |
end | ||
|
||
it 'doesn\'t raise an error for missing fields' do | ||
expect(mapper.depositor).to eq nil | ||
expect(mapper.source).to eq [] | ||
end | ||
end | ||
end | ||
|