Sha256: e5cf462641a36833ae2f908964722c878e53dc20b09b2275067acea21d68d2c7
Contents?: true
Size: 903 Bytes
Versions: 22
Compression:
Stored size: 903 Bytes
Contents
require 'rails_helper' module Kuroko2::Workflow::Task describe SubProcess do let(:definition) { create(:job_definition) } let(:sub_definition) { create(:job_definition) } let(:instance) do create(:job_instance, job_definition: definition).tap do |instance| instance.tokens.first.destroy end end let(:node) { Kuroko2::Workflow::Node.new(:sub_process, sub_definition.id.to_s) } let(:token) { create(:token, job_definition: definition, job_instance: instance) } let(:sub_instance) { sub_definition.job_instances.first } describe '#execute' do subject(:task) { SubProcess.new(node, token) } it do expect(task.execute).to eq :pass expect(Kuroko2::Token.count).to eq 2 expect(task.execute).to eq :pass sub_instance.touch(:finished_at) expect(task.execute).to eq :next end end end end
Version data entries
22 entries across 22 versions & 1 rubygems