# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Dor::Workflow::Client::WorkflowRoutes do
let(:mock_requestor) { instance_double(Dor::Workflow::Client::Requestor) }
let(:routes) { described_class.new(requestor: mock_requestor) }
let(:wf_xml) do
<<-EOXML
EOXML
end
describe '#add_lane_id_to_workflow_xml' do
it 'adds laneId attributes to all process elements' do
expected = <<-XML
XML
expect(routes.send(:add_lane_id_to_workflow_xml, 'lane1', wf_xml)).to be_equivalent_to(expected)
end
end
describe '#workflow' do
let(:xml) do
<<~XML
XML
end
before do
allow(routes).to receive(:workflow_xml) { xml }
end
it 'it returns a workflow' do
expect(routes.workflow(pid: 'druid:mw971zk1113', workflow_name: 'accessionWF')).to be_kind_of Dor::Workflow::Response::Workflow
end
end
end