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