spec/services/hyrax/workflow/workflow_factory_spec.rb in hyrax-1.1.1 vs spec/services/hyrax/workflow/workflow_factory_spec.rb in hyrax-2.0.0.beta1
- old
+ new
@@ -6,20 +6,21 @@
let(:permission_template) { Hyrax::PermissionTemplate.find_by!(admin_set_id: work.admin_set_id) }
let(:workflow) { create(:workflow, active: true, permission_template: permission_template) }
let(:attributes) { {} }
let(:user) { create(:user) }
let(:deposit_action) { Sipity::WorkflowAction.create!(workflow: workflow, name: 'start') }
+
subject { described_class.create(work, attributes, user) }
it 'creates a Sipity::Entity, assign entity specific responsibility (but not to the full workflow) then runs the WorkflowActionService' do
expect(Hyrax::Workflow::WorkflowActionService).to receive(:run).with(
subject: kind_of(Hyrax::WorkflowActionInfo), action: deposit_action
)
expect do
expect do
subject
end.to change { Sipity::Entity.count }.by(1)
- .and change { Sipity::EntitySpecificResponsibility.count }.by(1)
+ .and change { Sipity::EntitySpecificResponsibility.count }.by(1)
end.not_to change { Sipity::WorkflowResponsibility.count }
end
end
end