diff options
| author | Teddy Wing | 2017-09-04 16:50:19 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2017-09-04 16:50:19 +0200 | 
| commit | bf56f221a0eedbceea99a1e20c2876383aa6c0dd (patch) | |
| tree | 7a7ac1b9a645a6f82224d10cd24267f0c51603eb /spec/workers | |
| parent | 7e62487561b85831ba7dfedbf47ee614a0880842 (diff) | |
| download | chouette-core-bf56f221a0eedbceea99a1e20c2876383aa6c0dd.tar.bz2 | |
WorkbenchImportWorker spec: Change `entry_group_streams` to `subdirs`
This changed in the new `ZipService`. We're now using a `Subdir` object,
we we need to use that in the tests instead of the
`entry_group_streams`.
Diffstat (limited to 'spec/workers')
| -rw-r--r-- | spec/workers/workbench_import_worker_spec.rb | 13 | 
1 files changed, 9 insertions, 4 deletions
| diff --git a/spec/workers/workbench_import_worker_spec.rb b/spec/workers/workbench_import_worker_spec.rb index d74471a42..d30857320 100644 --- a/spec/workers/workbench_import_worker_spec.rb +++ b/spec/workers/workbench_import_worker_spec.rb @@ -23,12 +23,17 @@ RSpec.describe WorkbenchImportWorker, type: [:worker, :request] do    let( :upload_path ) { api_v1_netex_imports_path(format: :json) } -  let( :entry_group_streams ) do -    entry_count.times.map{ |i| double( "entry group stream #{i}" ) } +  let( :subdirs ) do +    entry_count.times.map do |i| +      ZipService::Subdir.new( +        "subdir #{i}", +        double("subdir #{i}", rewind: 0, read: '') +      ) +    end    end    let( :entry_groups ) do      entry_count.times.map do | i | -      {"entry_group_name#{i}" => entry_group_streams[i] } +      {"entry_group_name#{i}" => subdirs[i] }      end    end @@ -49,7 +54,7 @@ RSpec.describe WorkbenchImportWorker, type: [:worker, :request] do      allow(Api::V1::ApiKey).to receive(:from).and_return(api_key)      allow(ZipService).to receive(:new).with(downloaded_zip).and_return zip_service -    expect(zip_service).to receive(:entry_group_streams).and_return(entry_groups) +    expect(zip_service).to receive(:subdirs).and_return(subdirs)      expect( import ).to receive(:update).with(        status: 'running',        started_at: Time.now | 
