Sha256: 5a62118eb2e38ff946c7b39873eaf5b2d8b90bb120a8c78c3d796f23139f2cc9

Contents?: true

Size: 1.31 KB

Versions: 9

Compression:

Stored size: 1.31 KB

Contents

require 'spec_helper'

module Hyrax
  module Workflow
    RSpec.describe SipityActionsGenerator do
      let(:workflow) { Sipity::Workflow.new(name: 'Hello') }
      let(:actions_configuration) do
        [
          {
            name: "start_a_submission", transition_to: "new", emails: [
              { name: "confirmation_of_ulra_submission_started", to: "creating_user" }
            ]
          }, {
            name: "submit", transition_to: "done", from_states: [{ names: ["new"], roles: ["submitting"] }]
          }
        ]
      end

      let(:new_actions_configuration) do
        [
          {
            name: "submit", transition_to: "done", from_states: [{ names: ["new"], roles: ["submitting"] }]
          }
        ]
      end

      context '.call' do
        it 'is a convenience method' do
          expect_any_instance_of(described_class).to receive(:call)
          described_class.call(workflow: workflow, actions_configuration: actions_configuration)
        end
      end

      subject { described_class.new(workflow: workflow, actions_configuration: actions_configuration) }

      it 'parses the actions_configuration and calls the underlying DataGenerators::StateMachineGenerator' do
        allow_any_instance_of(StateMachineGenerator).to receive(:call)
        subject.call
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hyrax-1.1.1 spec/services/hyrax/workflow/sipity_actions_generator_spec.rb
hyrax-1.1.0 spec/services/hyrax/workflow/sipity_actions_generator_spec.rb
hyrax-1.0.5 spec/services/hyrax/workflow/sipity_actions_generator_spec.rb
hyrax-1.0.4 spec/services/hyrax/workflow/sipity_actions_generator_spec.rb
hyrax-1.0.3 spec/services/hyrax/workflow/sipity_actions_generator_spec.rb
hyrax-1.0.2 spec/services/hyrax/workflow/sipity_actions_generator_spec.rb
hyrax-1.0.1 spec/services/hyrax/workflow/sipity_actions_generator_spec.rb
hyrax-1.0.0.rc2 spec/services/hyrax/workflow/sipity_actions_generator_spec.rb
hyrax-1.0.0.rc1 spec/services/hyrax/workflow/sipity_actions_generator_spec.rb