From e2afd134b065df28f4802f518c338281ec3480a2 Mon Sep 17 00:00:00 2001 From: Zach Wolfenbarger Date: Fri, 14 Jun 2024 21:24:37 -0500 Subject: [PATCH] Access parsed json hash with string (#4349) * Access parsed json hash with string * Use correct hash syntax in AggController spec --- app/controllers/api/v1/aggregations_controller.rb | 2 +- spec/controllers/api/v1/aggregations_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/aggregations_controller.rb b/app/controllers/api/v1/aggregations_controller.rb index f47d3b089..c107c7189 100644 --- a/app/controllers/api/v1/aggregations_controller.rb +++ b/app/controllers/api/v1/aggregations_controller.rb @@ -17,7 +17,7 @@ def create create_params['links']['user'] ) super do |agg| - agg.update({ task_id: response[:task_id], status: 'pending' }) + agg.update({ task_id: response['task_id'], status: 'pending' }) end rescue AggregationClient::ConnectionError json_api_render(:service_unavailable, 'The aggregation service is unavailable or not responding') diff --git a/spec/controllers/api/v1/aggregations_controller_spec.rb b/spec/controllers/api/v1/aggregations_controller_spec.rb index cd4623e8f..ef00b712a 100644 --- a/spec/controllers/api/v1/aggregations_controller_spec.rb +++ b/spec/controllers/api/v1/aggregations_controller_spec.rb @@ -31,7 +31,7 @@ describe 'create' do let(:test_attr) { :workflow_id } let(:test_attr_value) { workflow.id } - let(:fake_response) { { 'task_id': 'asdf-1234-asdf' } } + let(:fake_response) { { 'task_id' => 'asdf-1234-asdf' } } let(:mock_agg) { instance_double(AggregationClient) } let(:create_params) do