Sha256: f5e7e120b4697aedc37c02b3c0224ab0f9b39c279c4c4ef3c01cfa613fb73fc7

Contents?: true

Size: 1.45 KB

Versions: 7

Compression:

Stored size: 1.45 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

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

  let(:parent) { Dor::Workflow::Response::Workflow.new(xml: xml) }

  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

7 entries across 7 versions & 1 rubygems

Version Path
dor-workflow-client-7.3.0 spec/dor/workflow/response/process_spec.rb
dor-workflow-client-7.2.0 spec/dor/workflow/response/process_spec.rb
dor-workflow-client-7.1.0 spec/dor/workflow/response/process_spec.rb
dor-workflow-client-7.0.2 spec/dor/workflow/response/process_spec.rb
dor-workflow-client-7.0.1 spec/dor/workflow/response/process_spec.rb
dor-workflow-client-7.0.0 spec/dor/workflow/response/process_spec.rb
dor-workflow-client-6.0.0 spec/dor/workflow/response/process_spec.rb