diff options
| author | Teddy Wing | 2017-09-05 13:22:11 +0200 |
|---|---|---|
| committer | Teddy Wing | 2017-09-05 13:22:11 +0200 |
| commit | 1485d68a3bef38fa3ed61cf610855861cea405b7 (patch) | |
| tree | ddf833bfba3e9ff2a522dcff24c6a6d8c078c761 /spec/support/with_commit.rb | |
| parent | edbdd5a05fb9b75a6565c31f37d1ce8a501db265 (diff) | |
| download | chouette-core-1485d68a3bef38fa3ed61cf610855861cea405b7.tar.bz2 | |
WorkbenchImportWorker spec: Catch `StopIteration` exception
The code was changed in 038710b22ccf3dd2421ec8d07fae45ef05a47ada, but
the tests weren't changed to reflect this.
In that change, the subdir enumeration is stopped if the `HTTPService`
POST request fails with an error.
This caused us to receive the following error when running the tests:
2) WorkbenchImportWorker multireferential zipfile with error downloads a zip file, cuts it, and uploads some pieces
Failure/Error:
expect { worker.perform import.id }.to raise_error(
StopIteration,
post_response_failure.body
)
expected StopIteration with {:error=>"What was you thinking"}, got #<StopIteration: {:error=>"What was you thinking"}> with backtrace:
# ./app/workers/workbench_import_worker.rb:63:in `upload_entry_group'
# ./app/workers/workbench_import_worker.rb:38:in `each'
# ./app/workers/workbench_import_worker.rb:38:in `each_with_index'
# ./app/workers/workbench_import_worker.rb:38:in `upload'
# ./app/workers/workbench_import_worker.rb:15:in `perform'
# ./spec/workers/workbench_import_worker_spec.rb:105:in `block (4 levels) in <top (required)>'
# ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in <top (required)>'
# -e:1:in `<main>'
# ./spec/workers/workbench_import_worker_spec.rb:105:in `block (3 levels) in <top (required)>'
# -e:1:in `<main>'
In order to get around this, just catch the error. Hopefully this is
right.
Diffstat (limited to 'spec/support/with_commit.rb')
0 files changed, 0 insertions, 0 deletions
