scinote-web/spec/services/experiments/generate_workflow_image_service_spec.rb

22 lines
582 B
Ruby
Raw Normal View History

# 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 }
let(:params) { { experiment: experiment } }
context 'when succeed' do
it 'succeed? returns true' do
2023-11-13 16:34:38 +08:00
expect(described_class.call(**params).succeed?).to be_truthy
end
it 'worklfow image of experiment is updated' do
old_filename = nil
2023-11-13 16:34:38 +08:00
described_class.call(**params)
experiment.reload
expect(experiment.workflowimg.blob.filename).not_to be == old_filename
end
end
end