From b41dc0a4d50f05c9a217832d324413ac8eef105c Mon Sep 17 00:00:00 2001 From: Urban Rotnik Date: Wed, 9 Jan 2019 18:48:09 +0100 Subject: [PATCH] Specs for workflow_image_fenerator fix SCI-2924 --- spec/services/workflow_image_generator_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/services/workflow_image_generator_spec.rb b/spec/services/workflow_image_generator_spec.rb index 654fdc1fb..9f9451100 100644 --- a/spec/services/workflow_image_generator_spec.rb +++ b/spec/services/workflow_image_generator_spec.rb @@ -3,4 +3,20 @@ require 'rails_helper' describe WorkflowImageGenerator do + let(:experiment) { create :experiment_with_tasks } + let(:params) { { experiment_id: experiment.id } } + + context 'when succeed' do + it 'succeed? returns true' do + expect(described_class.execute(params).succeed?).to be_truthy + end + + it 'worklfow image of experiment is updated' do + old_filename = experiment.workflowimg_file_name + described_class.execute(params) + experiment.reload + + expect(experiment.workflowimg_file_name).not_to be == old_filename + end + end end