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-01-10 01:48:09 +08:00
|
|
|
let(:experiment) { create :experiment_with_tasks }
|
|
|
|
let(:params) { { experiment_id: experiment.id } }
|
|
|
|
|
|
|
|
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
|
|
|
|
old_filename = experiment.workflowimg_file_name
|
2019-01-11 17:16:50 +08:00
|
|
|
described_class.call(params)
|
2019-01-10 01:48:09 +08:00
|
|
|
experiment.reload
|
|
|
|
|
|
|
|
expect(experiment.workflowimg_file_name).not_to be == old_filename
|
|
|
|
end
|
|
|
|
end
|
2019-01-07 22:55:45 +08:00
|
|
|
end
|