scinote-web/spec/services/experiments/generate_workflow_image_service_spec.rb
2019-08-09 14:56:00 +02:00

21 lines
617 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
describe Experiments::GenerateWorkflowImageService 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.call(params).succeed?).to be_truthy
end
it 'worklfow image of experiment is updated' do
old_filename = experiment.workflowimg.blob.filename
described_class.call(params)
experiment.reload
expect(experiment.workflowimg.blob.filename).not_to be == old_filename
end
end
end