Sha256: e3dff42d51b3bd09b1c8f970e7a103d93631a2e949305b68830f3dc672080509

Contents?: true

Size: 987 Bytes

Versions: 18

Compression:

Stored size: 987 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Dor::Workflow::Response::Workflows do
  subject(:instance) { described_class.new(xml: xml) }

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

    let(:xml) do
      <<~XML
        <workflows objectId="druid:mw971zk1113">
        </workflows>
      XML
    end
    it { is_expected.to eq 'druid:mw971zk1113' }
  end

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

    let(:xml) do
      <<~XML
        <workflows objectId="druid:mw971zk1113">
          <workflow repository="dor" objectId="druid:mw971zk1113" id="assemblyWF">
          </workflow>
          <workflow repository="dor" objectId="druid:mw971zk1113" id="sdrPreservationWF">
          </workflow>
        </workflows>
      XML
    end

    it 'has children' do
      expect(subject).to all(be_kind_of Dor::Workflow::Response::Workflow)
      expect(subject.map(&:workflow_name)).to eq %w[assemblyWF sdrPreservationWF]
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dor-workflow-client-3.15.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.14.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.13.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.12.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.11.1 spec/models/response/workflows_spec.rb
dor-workflow-client-3.11.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.10.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.9.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.8.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.7.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.6.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.5.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.4.2 spec/models/response/workflows_spec.rb
dor-workflow-client-3.4.1 spec/models/response/workflows_spec.rb
dor-workflow-client-3.4.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.3.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.2.0 spec/models/response/workflows_spec.rb
dor-workflow-client-3.1.0 spec/models/response/workflows_spec.rb