Skip to content

Commit

Permalink
CV2-5225: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
melsawy committed Sep 8, 2024
1 parent ad95f02 commit 5c74496
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions test/controllers/elastic_search_7_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5c74496

Please sign in to comment.