aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-08-25 12:17:38 +0200
committerTeddy Wing2017-08-25 12:17:38 +0200
commite18419a1b829cc790f384a80995e6de544e5ff40 (patch)
tree3396e51551eea856d6a7ebaea4e2d7f4037e04b3
parent45fa48e534237e40e82435dcadbc30dd71938bb2 (diff)
downloadchouette-core-e18419a1b829cc790f384a80995e6de544e5ff40.tar.bz2
WorkbenchImportWorker spec: Change `#update_attributes` to `#update`
Now that the code has been changed to use `#update`, update these test mocks to bind to the right method.
-rw-r--r--spec/workers/workbench_import_worker_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/workers/workbench_import_worker_spec.rb b/spec/workers/workbench_import_worker_spec.rb
index b7f8025a4..3030f8d64 100644
--- a/spec/workers/workbench_import_worker_spec.rb
+++ b/spec/workers/workbench_import_worker_spec.rb
@@ -48,7 +48,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( import ).to receive(:update_attributes).with(status: 'running')
+ expect( import ).to receive(:update).with(status: 'running')
end
@@ -65,9 +65,9 @@ RSpec.describe WorkbenchImportWorker, type: [:worker, :request] do
mock_post entry_group_name, entry_group_stream, post_response_ok
end
- expect( import ).to receive(:update_attributes).with(total_steps: 2)
- expect( import ).to receive(:update_attributes).with(current_step: 1)
- expect( import ).to receive(:update_attributes).with(current_step: 2)
+ expect( import ).to receive(:update).with(total_steps: 2)
+ expect( import ).to receive(:update).with(current_step: 1)
+ expect( import ).to receive(:update).with(current_step: 2)
worker.perform import.id
@@ -93,10 +93,10 @@ RSpec.describe WorkbenchImportWorker, type: [:worker, :request] do
mock_post entry_group_name, entry_group_stream, post_response_failure
end
- expect( import ).to receive(:update_attributes).with(total_steps: 3)
- expect( import ).to receive(:update_attributes).with(current_step: 1)
- expect( import ).to receive(:update_attributes).with(current_step: 2)
- expect( import ).to receive(:update_attributes).with(current_step: 3, status: 'failed')
+ expect( import ).to receive(:update).with(total_steps: 3)
+ expect( import ).to receive(:update).with(current_step: 1)
+ expect( import ).to receive(:update).with(current_step: 2)
+ expect( import ).to receive(:update).with(current_step: 3, status: 'failed')
worker.perform import.id