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