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

23 lines
610 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_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
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)
experiment.reload
expect(experiment.workflowimg_file_name).not_to be == old_filename
end
end
end