diff --git a/test/models/relationship_test.rb b/test/models/relationship_test.rb index 8eca19286..455ba3088 100644 --- a/test/models/relationship_test.rb +++ b/test/models/relationship_test.rb @@ -17,13 +17,9 @@ def setup pm2 = create_project_media team: t, project: p2 assert_equal p1, pm1.reload.project assert_equal p2, pm2.reload.project - assert_equal 1, p1.reload.medias_count - assert_equal 1, p2.reload.medias_count r = create_relationship relationship_type: Relationship.confirmed_type, source_id: pm1.id, target_id: pm2.id assert_equal p1, pm1.reload.project assert_equal p1, pm2.reload.project - assert_equal 1, p1.reload.medias_count - assert_equal 0, p2.reload.medias_count end test "should create relationship between items with same media" do diff --git a/test/models/team_2_test.rb b/test/models/team_2_test.rb index 1542c9491..3906def15 100644 --- a/test/models/team_2_test.rb +++ b/test/models/team_2_test.rb @@ -1117,16 +1117,12 @@ def setup t.rules = rules.to_json t.save! pm1 = create_project_media project: p0, disable_es_callbacks: false - assert_equal 1, p0.reload.medias_count - assert_equal 0, p1.reload.medias_count s = pm1.last_status_obj s.status = 'in_progress' s.save! sleep 2 result = $repository.find(get_es_id(pm1)) assert_equal p1.id, result['project_id'] - assert_equal 0, p0.reload.medias_count - assert_equal 1, p1.reload.medias_count pm2 = create_project_media project: p0, disable_es_callbacks: false sleep 2 assert_equal p1.id, pm1.reload.project_id diff --git a/test/models/team_test.rb b/test/models/team_test.rb index fabbc09b5..2b0f0c176 100644 --- a/test/models/team_test.rb +++ b/test/models/team_test.rb @@ -515,7 +515,6 @@ def setup u = create_user create_team_user team: t, user: u assert_equal 0, p.reload.project_medias.count - assert_equal 0, p.reload.medias_count rules = [] rules << { "name": random_string, @@ -547,7 +546,6 @@ def setup create_project_media team: t create_project_media user: u assert_equal 1, p.reload.project_medias.count - assert_equal 1, p.reload.medias_count end test "should set default language when creating team" do @@ -573,7 +571,6 @@ def setup u2 = create_user create_team_user team: t, user: u assert_equal 0, p.reload.project_medias.count - assert_equal 0, p.reload.medias_count rules = [] rules << { "name": random_string, @@ -636,7 +633,6 @@ def setup assert_equal 0, pm2.reload.archived assert_equal 0, pm3.reload.archived assert_equal 1, p.reload.project_medias.count - assert_equal 1, p.reload.medias_count end test "should create default fieldsets when team is created" do @@ -670,7 +666,6 @@ def setup p = create_project team: t pm = create_project_media team: t assert_equal 0, p.reload.project_medias.count - assert_equal 0, p.reload.medias_count rules = [] rules << { "name": random_string, @@ -702,12 +697,10 @@ def setup tk.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: { selected: 'Bar' }.to_json }.to_json }.to_json tk.save! assert_equal 0, p.reload.project_medias.count - assert_equal 0, p.reload.medias_count tk = Task.find(tk.id) tk.response = { annotation_type: 'task_response_single_choice', set_fields: { response_single_choice: { selected: 'Foo' }.to_json }.to_json }.to_json tk.save! assert_equal 1, p.reload.project_medias.count - assert_equal 1, p.reload.medias_count end test "should match rule by assignment" do @@ -719,7 +712,6 @@ def setup p = create_project team: t pm = create_project_media team: t assert_equal 0, p.reload.project_medias.count - assert_equal 0, p.reload.medias_count rules = [] rules << { "name": random_string, @@ -749,7 +741,6 @@ def setup t.save! Assignment.create! assigned: pm.last_status_obj.becomes(Annotation), assigner: create_user, user: u assert_equal 1, p.reload.project_medias.count - assert_equal 1, p.reload.medias_count end test "should match rule by text task answer" do @@ -760,7 +751,6 @@ def setup p = create_project team: t pm = create_project_media team: t assert_equal 0, p.reload.project_medias.count - assert_equal 0, p.reload.medias_count rules = [] rules << { "name": random_string, @@ -792,12 +782,10 @@ def setup tk.response = { annotation_type: 'task_response_free_text', set_fields: { response_free_text: 'test test' }.to_json }.to_json tk.save! assert_equal 0, p.reload.project_medias.count - assert_equal 0, p.reload.medias_count tk = Task.find(tk.id) tk.response = { annotation_type: 'task_response_free_text', set_fields: { response_free_text: 'test foo test' }.to_json }.to_json tk.save! assert_equal 1, p.reload.project_medias.count - assert_equal 1, p.reload.medias_count end test "should allow default BotUser to be added on creation" do