Sha256: 8b409d2b086ca5d1e2898e1d033874cd0a32c0b2e73c7033c1c49693e5d63b06

Contents?: true

Size: 1.43 KB

Versions: 13

Compression:

Stored size: 1.43 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
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dor-workflow-client-3.16.0 spec/models/response/process_spec.rb
dor-workflow-client-3.15.1 spec/models/response/process_spec.rb
dor-workflow-client-3.15.0 spec/models/response/process_spec.rb
dor-workflow-client-3.14.0 spec/models/response/process_spec.rb
dor-workflow-client-3.13.0 spec/models/response/process_spec.rb
dor-workflow-client-3.12.0 spec/models/response/process_spec.rb
dor-workflow-client-3.11.1 spec/models/response/process_spec.rb
dor-workflow-client-3.11.0 spec/models/response/process_spec.rb
dor-workflow-client-3.10.0 spec/models/response/process_spec.rb
dor-workflow-client-3.9.0 spec/models/response/process_spec.rb
dor-workflow-client-3.8.0 spec/models/response/process_spec.rb
dor-workflow-client-3.7.0 spec/models/response/process_spec.rb
dor-workflow-client-3.6.0 spec/models/response/process_spec.rb