2019-01-07 22:55:45 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2019-01-11 17:16:50 +08:00
|
|
|
describe Experiments::GenerateWorkflowImageService do
|
2019-03-13 16:06:48 +08:00
|
|
|
let(:experiment) { create :experiment, :with_tasks }
|
2020-10-16 20:21:25 +08:00
|
|
|
let(:params) { { experiment: experiment } }
|
2019-01-10 01:48:09 +08:00
|
|
|
|
|
|
|
context 'when succeed' do
|
|
|
|
it 'succeed? returns true' do
|
2019-01-11 17:16:50 +08:00
|
|
|
expect(described_class.call(params).succeed?).to be_truthy
|
2019-01-10 01:48:09 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'worklfow image of experiment is updated' do
|
2019-08-21 17:15:57 +08:00
|
|
|
old_filename = nil
|
2019-01-11 17:16:50 +08:00
|
|
|
described_class.call(params)
|
2019-01-10 01:48:09 +08:00
|
|
|
experiment.reload
|
2019-08-09 20:56:00 +08:00
|
|
|
expect(experiment.workflowimg.blob.filename).not_to be == old_filename
|
2019-01-10 01:48:09 +08:00
|
|
|
end
|
|
|
|
end
|
2019-01-07 22:55:45 +08:00
|
|
|
end
|