forked from coinbase/temporal-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_workflow_spec.rb
36 lines (29 loc) · 988 Bytes
/
start_workflow_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'workflows/hello_world_workflow'
describe 'Temporal.start_workflow' do
let(:workflow_id) { SecureRandom.uuid }
it 'starts a workflow using a class reference' do
run_id = Temporal.start_workflow(HelloWorldWorkflow, 'Test', options: {
workflow_id: workflow_id
})
result = Temporal.await_workflow_result(
HelloWorldWorkflow,
workflow_id: workflow_id,
run_id: run_id
)
expect(result).to eq('Hello World, Test')
end
it 'starts a workflow using a string reference' do
run_id = Temporal.start_workflow('HelloWorldWorkflow', 'Test', options: {
workflow_id: workflow_id,
namespace: Temporal.configuration.namespace,
task_queue: Temporal.configuration.task_queue
})
result = Temporal.await_workflow_result(
'HelloWorldWorkflow',
workflow_id: workflow_id,
run_id: run_id,
namespace: Temporal.configuration.namespace
)
expect(result).to eq('Hello World, Test')
end
end