From 9577e01bc548617fc4bade03ed0c29f0b8bf2d14 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Mon, 18 Sep 2023 15:00:40 +0200 Subject: [PATCH] Fix tests --- app/controllers/annotations_controller.rb | 2 +- app/controllers/score_items_controller.rb | 2 +- app/controllers/scores_controller.rb | 2 +- test/factories/evaluations.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/annotations_controller.rb b/app/controllers/annotations_controller.rb index 4c283132f4..5f8a6c77c1 100644 --- a/app/controllers/annotations_controller.rb +++ b/app/controllers/annotations_controller.rb @@ -85,7 +85,7 @@ def update def destroy @annotation.destroy - render status: :no_content + head :no_content end private diff --git a/app/controllers/score_items_controller.rb b/app/controllers/score_items_controller.rb index 0cafb44d53..0b67381489 100644 --- a/app/controllers/score_items_controller.rb +++ b/app/controllers/score_items_controller.rb @@ -67,7 +67,7 @@ def destroy @score_item.destroy respond_to do |format| format.js { render 'score_items/index', locals: { new: nil, evaluation_exercise: preload_eval_exercise(@score_item) } } - format.json { render status: :no_content } + format.json { head :no_content } end end diff --git a/app/controllers/scores_controller.rb b/app/controllers/scores_controller.rb index c597a3c09e..7483937cc6 100644 --- a/app/controllers/scores_controller.rb +++ b/app/controllers/scores_controller.rb @@ -38,7 +38,7 @@ def destroy set_common respond_to do |format| format.js { render 'feedbacks/show' } - format.json { render status: :no_content } + format.json { head :no_content } end end diff --git a/test/factories/evaluations.rb b/test/factories/evaluations.rb index 457282ded8..e4b6135f5a 100644 --- a/test/factories/evaluations.rb +++ b/test/factories/evaluations.rb @@ -11,7 +11,7 @@ # FactoryBot.define do factory :evaluation do - series { { deadline: DateTime.now - 1.minute } } + series { association :series, deadline: DateTime.now - 1.minute } deadline { series.deadline || (DateTime.now - 1.minute) } released { false } exercises { series.exercises }