Skip to content

Commit

Permalink
TODO-fix-csv-parser-spec (#625)
Browse files Browse the repository at this point in the history
* fix the commented out part of the #write_partial_import_file spec in the csv parser file

* reset the HYKU_MULTITENANT value after the spec completes
  • Loading branch information
alishaevn authored Aug 5, 2022
1 parent b2a0dac commit 5410612
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions spec/parsers/bulkrax/csv_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -372,19 +372,22 @@ module Bulkrax
end

context 'in a multi tenant application' do
# TODO(alishaevn): get this spec to work
let(:site) { instance_double(Site, id: 1, account_id: 1) }
let(:account) { instance_double(Account, id: 1, name: 'bulkrax') }

before do
allow(Site).to receive(:instance).and_return(site)
allow(Site.instance).to receive(:account).and_return(account)
ENV['HYKU_MULTITENANT'] = 'true'
# allow(Site).to receive(instance).and_return({})
# allow(Site.instance).to receive(account).and_return({})
# allow(Site.instance.account).to receive(name).and_return('hyku')
end

# allow('base_path').to receive(::Site.instance.account.name).and_return('hyku')
after do
ENV['HYKU_MULTITENANT'] = 'false'
end

xit 'returns the path of the partial import file' do
it 'returns the path of the partial import file' do
expect(subject.write_partial_import_file(file))
.to eq("tmp/imports/hyku/#{importer.id}_#{importer.created_at.strftime('%Y%m%d%H%M%S')}/failed_corrected_entries.csv")
.to eq("tmp/imports/bulkrax/#{importer.id}_#{importer.created_at.strftime('%Y%m%d%H%M%S')}/failed_corrected_entries.csv")
end
end
end
Expand Down

0 comments on commit 5410612

Please sign in to comment.