From 5410612d62a1cb834d2388962b6f5148e662a56e Mon Sep 17 00:00:00 2001 From: Alisha Evans Date: Fri, 5 Aug 2022 09:58:10 -0500 Subject: [PATCH] TODO-fix-csv-parser-spec (#625) * 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 --- spec/parsers/bulkrax/csv_parser_spec.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/spec/parsers/bulkrax/csv_parser_spec.rb b/spec/parsers/bulkrax/csv_parser_spec.rb index b462f9fa..585232e8 100644 --- a/spec/parsers/bulkrax/csv_parser_spec.rb +++ b/spec/parsers/bulkrax/csv_parser_spec.rb @@ -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