Sha256: fcd4329b7d0b6f0ac1d1d1cccd14f067048db02ac25d9cbe25d661347b74797d

Contents?: true

Size: 1019 Bytes

Versions: 13

Compression:

Stored size: 1019 Bytes

Contents

require 'spec_helper'
describe CurationConcerns::Actors::InitializeWorkflowActor, :workflow do
  let(:user) { create(:user) }
  let(:curation_concern) { GenericWork.new }
  let(:attributes) { { title: ['test'] } }

  subject do
    CurationConcerns::Actors::ActorStack.new(curation_concern,
                                             user,
                                             [described_class,
                                              CurationConcerns::Actors::GenericWorkActor])
  end

  describe 'the next actor' do
    let(:root_actor) { double }
    before do
      allow(CurationConcerns::Actors::RootActor).to receive(:new).and_return(root_actor)
    end

    it 'passes the attributes on' do
      expect(root_actor).to receive(:create).with(title: ['test'])
      subject.create(attributes)
    end
  end

  describe 'create' do
    it 'creates an entity' do
      expect {
        expect(subject.create(attributes)).to be true
      }.to change { Sipity::Entity.count }.by(1)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-1.7.7 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-2.0.0 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-2.0.0.rc2 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-1.7.6 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-1.7.5 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-1.7.4 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-1.7.3 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-1.7.2 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-2.0.0.rc1 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-1.7.1 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-1.7.0 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb
curation_concerns-1.7.0.beta1 spec/actors/curation_concerns/initialize_workflow_actor_spec.rb