Skip to content

Commit

Permalink
🧹 [i1010] combine embargo and lease test fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaLMoore committed Apr 17, 2024
1 parent 04e599e commit 2156476
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 3 additions & 0 deletions spec/fixtures/csv/embargo-lease.csv
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions spec/fixtures/csv/embargo.csv

This file was deleted.

2 changes: 0 additions & 2 deletions spec/fixtures/csv/lease.csv

This file was deleted.

10 changes: 5 additions & 5 deletions spec/models/bulkrax/csv_entry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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
Expand All @@ -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',
Expand All @@ -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')
Expand Down

0 comments on commit 2156476

Please sign in to comment.