Skip to content

Commit 4ada38b

Browse files
update: fix key naming for variation_id in CMAB response handling in spec file
1 parent 4becfbf commit 4ada38b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/cmab/cmab_client_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
it 'should return the variation id on success' do
6161
WebMock.stub_request(:post, expected_url)
6262
.with(body: expected_body_for_webmock, headers: expected_headers)
63-
.to_return(status: 200, body: {'predictions' => [{'variationId' => 'abc123'}]}.to_json, headers: {'Content-Type' => 'application/json'})
63+
.to_return(status: 200, body: {'predictions' => [{'variation_id' => 'abc123'}]}.to_json, headers: {'Content-Type' => 'application/json'})
6464

6565
result = client.fetch_decision(rule_id, user_id, attributes, cmab_uuid)
6666

@@ -137,7 +137,7 @@
137137
it 'should return the variation id on first try' do
138138
WebMock.stub_request(:post, expected_url)
139139
.with(body: expected_body_for_webmock, headers: expected_headers)
140-
.to_return(status: 200, body: {'predictions' => [{'variationId' => 'abc123'}]}.to_json, headers: {'Content-Type' => 'application/json'})
140+
.to_return(status: 200, body: {'predictions' => [{'variation_id' => 'abc123'}]}.to_json, headers: {'Content-Type' => 'application/json'})
141141

142142
result = client_with_retry.fetch_decision(rule_id, user_id, attributes, cmab_uuid)
143143

@@ -152,7 +152,7 @@
152152
.with(body: expected_body_for_webmock, headers: expected_headers)
153153
.to_return({status: 500},
154154
{status: 500},
155-
{status: 200, body: {'predictions' => [{'variationId' => 'xyz456'}]}.to_json, headers: {'Content-Type' => 'application/json'}})
155+
{status: 200, body: {'predictions' => [{'variation_id' => 'xyz456'}]}.to_json, headers: {'Content-Type' => 'application/json'}})
156156

157157
result = client_with_retry.fetch_decision(rule_id, user_id, attributes, cmab_uuid)
158158

0 commit comments

Comments
 (0)