forked from coinbase/temporal-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupsert_search_attributes_spec.rb
38 lines (33 loc) · 1.08 KB
/
upsert_search_attributes_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
37
38
require 'workflows/upsert_search_attributes_workflow'
require 'time'
describe 'Temporal::Workflow::Context.upsert_search_attributes', :integration do
it 'can upsert a search attribute and then retrieve it' do
workflow_id = 'upsert_search_attributes_test_wf-' + SecureRandom.uuid
expected_attributes = {
'CustomStringField' => 'moo',
'CustomBoolField' => true,
'CustomDoubleField' => 3.14,
'CustomIntField' => 0,
'CustomDatetimeField' => Time.now.utc.iso8601,
}
run_id = Temporal.start_workflow(
UpsertSearchAttributesWorkflow,
*expected_attributes.values,
options: {
workflow_id: workflow_id,
},
)
added_attributes = Temporal.await_workflow_result(
UpsertSearchAttributesWorkflow,
workflow_id: workflow_id,
run_id: run_id,
)
expect(added_attributes).to eq(expected_attributes)
execution_info = Temporal.fetch_workflow_execution_info(
integration_spec_namespace,
workflow_id,
nil
)
expect(execution_info.search_attributes).to eq(expected_attributes)
end
end