diff --git a/spec/fixtures/csv/embargo-lease.csv b/spec/fixtures/csv/embargo-lease.csv new file mode 100644 index 00000000..93acff0b --- /dev/null +++ b/spec/fixtures/csv/embargo-lease.csv @@ -0,0 +1,3 @@ +model,title,creator,source_identifier,visibility,visibility_during_embargo,embargo_release_date,visibility_after_embargo,visibility_during_lease,lease_expiration_date,visibility_after_lease +Work,An Image,user,123456789,embargo,restricted,2024-04-19,open,,,, +Work,An Image,user,1987654321,lease,,,,restricted,2024-04-19,open \ No newline at end of file diff --git a/spec/fixtures/csv/embargo.csv b/spec/fixtures/csv/embargo.csv deleted file mode 100644 index fabda9fc..00000000 --- a/spec/fixtures/csv/embargo.csv +++ /dev/null @@ -1,2 +0,0 @@ -model,title,creator,source_identifier,visibility, visibility_during_embargo,embargo_release_date,visibility_after_embargo -Work,An Image,user,123456789,restricted,embargo,2024-04-19,open \ No newline at end of file diff --git a/spec/fixtures/csv/lease.csv b/spec/fixtures/csv/lease.csv deleted file mode 100644 index 2e727d9e..00000000 --- a/spec/fixtures/csv/lease.csv +++ /dev/null @@ -1,2 +0,0 @@ -model,title,creator,rights_statement,source_identifier,visibility,visibility_during_lease,lease_expiration_date,visibility_after_lease -Image,An Image,user,http://rightsstatements.org/vocab/InC/1.0,987654321,lease,restricted,2024-04-19,open \ No newline at end of file diff --git a/spec/models/bulkrax/csv_entry_spec.rb b/spec/models/bulkrax/csv_entry_spec.rb index 571b3b15..bb246ad5 100644 --- a/spec/models/bulkrax/csv_entry_spec.rb +++ b/spec/models/bulkrax/csv_entry_spec.rb @@ -1257,7 +1257,7 @@ class ::Avacado < Work end end - describe 'exposing lease attributes for parser' do + describe 'exposing embargo attributes for parser' do let(:data) { { 'model': 'Work', @@ -1273,7 +1273,7 @@ class ::Avacado < Work let(:entry) { Bulkrax::EntrySpecHelper.entry_for(identifier: '123456789', data: data, parser_class_name: 'Bulkrax::CsvParser', - parser_fields: { 'import_file_path': 'spec/fixtures/csv/embargo.csv'} ) } + parser_fields: { 'import_file_path': 'spec/fixtures/csv/embargo-lease.csv'} ) } it 'embargo attributes are included in the parsed metadata' do entry.build_metadata @@ -1291,7 +1291,7 @@ class ::Avacado < Work 'model': 'Work', 'title': 'Image', 'creator': 'user A', - 'source_identifier': '123456789', + 'source_identifier': '987654321', 'visibility': 'lease', 'visibility_during_lease': 'restricted', 'lease_expiration_date': '2054-04-19', @@ -1301,9 +1301,9 @@ class ::Avacado < Work let(:entry) { Bulkrax::EntrySpecHelper.entry_for(identifier: '123456789', data: data, parser_class_name: 'Bulkrax::CsvParser', - parser_fields: { 'import_file_path': 'spec/fixtures/csv/lease.csv'} ) } + parser_fields: { 'import_file_path': 'spec/fixtures/csv/embargo-lease.csv'} ) } - it 'embargo attributes are included in the parsed metadata' do + it 'lease attributes are included in the parsed metadata' do entry.build_metadata expect(entry.parsed_metadata['visibility']).to eq('lease')