Skip to content

Commit

Permalink
Do not raise warnings for expected headers (#690)
Browse files Browse the repository at this point in the history
Add expected headers to the allowed_headers method so they do not raise
warnings.
  • Loading branch information
bess authored and little9 committed Oct 24, 2019
1 parent 6b1ee14 commit ae8dafd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/importers/curate_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def initialize(attributes = {})

# What columns are allowed in the CSV
def self.allowed_headers
CURATE_TERMS_MAP.values + ['filename']
CURATE_TERMS_MAP.values + ['filename', 'type', 'intermediate_file', 'fileset_label', 'preservation_master_file']
end

# Given a field name, return the CSV header
Expand Down
8 changes: 8 additions & 0 deletions spec/system/import_langmuir_from_csv_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ def start_import(page)
expect(page).to have_content(/This import will create or update (17|20) records./)
# There is a link so the user can cancel.
expect(page).to have_link 'Cancel', href: '/csv_imports/new?locale=en'

# We get warnings about unsupported fields
expect(page).to have_content('The field name "rights - digitization basis note" is not supported.')
expect(page).not_to have_content('The field name "type" is not supported')
expect(page).not_to have_content('The field name "intermediate_file" is not supported')
expect(page).not_to have_content('The field name "fileset_label" is not supported')
expect(page).not_to have_content('The field name "preservation_master_file" is not supported')

# After reading the warnings, the user decides
# to continue with the import.
click_on 'Start Import'
Expand Down

0 comments on commit ae8dafd

Please sign in to comment.