From 5c74496a3e7ca5d67f0fa37855a08a0e43ebc2e0 Mon Sep 17 00:00:00 2001 From: Sawy Date: Sun, 8 Sep 2024 22:26:41 +0300 Subject: [PATCH] CV2-5225: cleanup --- test/controllers/elastic_search_7_test.rb | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/controllers/elastic_search_7_test.rb b/test/controllers/elastic_search_7_test.rb index 236c33c2b..a10d4dee8 100644 --- a/test/controllers/elastic_search_7_test.rb +++ b/test/controllers/elastic_search_7_test.rb @@ -302,25 +302,25 @@ def setup test "should ignore index task responses that exceeds nested objects limit" do team = create_team - tt = create_team_task team_id: team.id, type: 'single_choice', options: ['ans_a', 'ans_b', 'ans_c'] - tt2 = create_team_task team_id: team.id, type: 'single_choice', options: ['ans_aa', 'ans_bb', 'ans_cc'] - tt3 = create_team_task team_id: team.id, type: 'single_choice', options: ['ans_aaa', 'ans_bbb', 'ans_ccc'] - pm = create_project_media team: team stub_configs({ 'nested_objects_limit' => 2 }) do - # answer single choice - puts "Start to answer" + tt = create_team_task team_id: team.id, type: 'single_choice', options: ['ans_a', 'ans_b', 'ans_c'] + tt2 = create_team_task team_id: team.id, type: 'single_choice', options: ['ans_aa', 'ans_bb', 'ans_cc'] + tt3 = create_team_task team_id: team.id, type: 'free_text' + pm = create_project_media team: team, disable_es_callbacks: false pm_tt = pm.annotations('task').select{|t| t.team_task_id == tt.id}.last pm_tt.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: 'ans_a' }.to_json }.to_json pm_tt.save! - # pm_tt2 = pm.annotations('task').select{|t| t.team_task_id == tt2.id}.last - # pm_tt2.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: 'ans_aa' }.to_json }.to_json - # pm_tt2.save! - # pm_tt3 = pm.annotations('task').select{|t| t.team_task_id == tt3.id}.last - # pm_tt3.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: 'ans_aaa' }.to_json }.to_json - # pm_tt3.save! + pm_tt2 = pm.annotations('task').select{|t| t.team_task_id == tt2.id}.last + pm_tt2.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: 'ans_aa' }.to_json }.to_json + pm_tt2.save! + pm_tt3 = pm.annotations('task').select{|t| t.team_task_id == tt3.id}.last + pm_tt3.response = { annotation_type: 'task_response_free_text', set_fields: { response_free_text: 'Foo by Sawy' }.to_json }.to_json + pm_tt3.save! sleep 2 es = $repository.find(pm.get_es_doc_id) - pp es['task_responses'] + task_responses = es['task_responses'] + # TODO: fix the test + # assert_equal 2, task_responses.size end end