Sha256: a529f5d45eb578418d8c982dade59b80d1a1ea71ecc6e0b8e8a76f232d8b5518

Contents?: true

Size: 1.73 KB

Versions: 9

Compression:

Stored size: 1.73 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 '#repository' do
    subject { instance.repository }

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

9 entries across 9 versions & 1 rubygems

Version Path
dor-workflow-client-3.22.0 spec/models/response/process_spec.rb
dor-workflow-client-3.21.0 spec/models/response/process_spec.rb
dor-workflow-client-3.20.1 spec/models/response/process_spec.rb
dor-workflow-client-3.20.0 spec/models/response/process_spec.rb
dor-workflow-client-3.19.0 spec/models/response/process_spec.rb
dor-workflow-client-3.18.1 spec/models/response/process_spec.rb
dor-workflow-client-3.18.0 spec/models/response/process_spec.rb
dor-workflow-client-3.17.1 spec/models/response/process_spec.rb
dor-workflow-client-3.17.0 spec/models/response/process_spec.rb