aboutsummaryrefslogtreecommitdiffstats
path: root/spec/workers
diff options
context:
space:
mode:
authorRobert2017-10-23 13:30:57 +0200
committerRobert2017-10-24 15:28:45 +0200
commitf88df773cb31c9967430af0c3cd7bd9df46e46e0 (patch)
tree41865abc47ae4fd254447a83cd998afcf33a128d /spec/workers
parentddd885d2acec8a39a82dfb34e7810b52c8f01c94 (diff)
downloadchouette-core-f88df773cb31c9967430af0c3cd7bd9df46e46e0.tar.bz2
Fixes: #4633@0.5h; Implenting correct message for inconsistent zip file
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/workbench_import/workbench_import_worker_spec.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/workers/workbench_import/workbench_import_worker_spec.rb b/spec/workers/workbench_import/workbench_import_worker_spec.rb
index 17cb7e16b..9f860a6b3 100644
--- a/spec/workers/workbench_import/workbench_import_worker_spec.rb
+++ b/spec/workers/workbench_import/workbench_import_worker_spec.rb
@@ -114,6 +114,9 @@ RSpec.describe WorkbenchImportWorker, type: [:worker, :request] do
let( :spurious2 ){ [random_string, random_string] }
let( :spurious ){ [spurious1, spurious2] }
let( :messages ){ double('messages') }
+ let( :message_attributes ){{criticity: :warning, message_key: 'inconsistent_zip_file'}}
+ let( :message1_attributes ){ message_attributes.merge(message_attributes: {'import_name' => import.name, 'spurious_dirs' => spurious1.inspect}) }
+ let( :message2_attributes ){ message_attributes.merge(message_attributes: {'import_name' => import.name, 'spurious_dirs' => spurious2.inspect}) }
before do
allow(import).to receive(:messages).and_return(messages)
@@ -131,9 +134,9 @@ RSpec.describe WorkbenchImportWorker, type: [:worker, :request] do
expect( import ).to receive(:update).with(total_steps: 2)
expect( import ).to receive(:update).with(current_step: 1)
- expect( messages ).to receive(:create).with(criticity: :warning, message_key: 'xxx')
+ expect( messages ).to receive(:create).with(message1_attributes)
expect( import ).to receive(:update).with(current_step: 2)
- expect( messages ).to receive(:create).with(criticity: :warning, message_key: 'xxx')
+ expect( messages ).to receive(:create).with(message2_attributes)
expect( import ).to receive(:update).with(ended_at: Time.now)
worker.perform import.id