Sha256: 5acb741c94512f09f4b750df92b1fbbbee345101d0bdfb80f7b9f3a2adbc0ef1

Contents?: true

Size: 1.44 KB

Versions: 2

Compression:

Stored size: 1.44 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Dor::Workflow::Response::Process do
  let(:parent) { Dor::Workflow::Response::Workflow.new(xml: xml) }
  subject(:instance) { parent.process_for_recent_version(name: 'start-assembly') }

  describe '#pid' do
    subject { instance.pid }

    let(:xml) do
      <<~XML
        <workflow repository="dor" objectId="druid:mw971zk1113" id="assemblyWF">
          <process name="start-assembly">
        </workflow>
      XML
    end
    it { is_expected.to eq 'druid:mw971zk1113' }
  end

  describe '#workflow_name' do
    subject { instance.workflow_name }

    let(:xml) do
      <<~XML
        <workflow repository="dor" objectId="druid:mw971zk1113" id="assemblyWF">
          <process name="start-assembly">
        </workflow>
      XML
    end
    it { is_expected.to eq 'assemblyWF' }
  end

  describe '#name' do
    subject { instance.name }

    let(:xml) do
      <<~XML
        <workflow repository="dor" objectId="druid:mw971zk1113" id="assemblyWF">
          <process name="start-assembly">
        </workflow>
      XML
    end
    it { is_expected.to eq 'start-assembly' }
  end

  describe '#lane_id' do
    subject { instance.lane_id }

    let(:xml) do
      <<~XML
        <workflow repository="dor" objectId="druid:mw971zk1113" id="assemblyWF">
          <process name="start-assembly" laneId="default">
        </workflow>
      XML
    end
    it { is_expected.to eq 'default' }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dor-workflow-client-5.1.0 spec/models/response/process_spec.rb
dor-workflow-client-5.0.0 spec/models/response/process_spec.rb