From 3260d8f82fa1c0c024a91238e73171de24874ae4 Mon Sep 17 00:00:00 2001 From: Karol Date: Tue, 11 Jan 2022 22:17:09 +0100 Subject: [PATCH] tiny refactor from exercise_found to task_found --- app/controllers/exercises_controller.rb | 2 +- app/views/exercises/_export_actions.html.slim | 2 +- spec/controllers/exercises_controller_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 37be0aa2..54600a4d 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -118,7 +118,7 @@ raise: false partial: 'export_actions', locals: { exercise: @exercise, - exercise_found: codeharbor_check[:task_found], + task_found: codeharbor_check[:task_found], update_right: codeharbor_check[:update_right], error: codeharbor_check[:error], exported: false, diff --git a/app/views/exercises/_export_actions.html.slim b/app/views/exercises/_export_actions.html.slim index 0484d2b2..14af1f34 100644 --- a/app/views/exercises/_export_actions.html.slim +++ b/app/views/exercises/_export_actions.html.slim @@ -4,7 +4,7 @@ = t('exercises.export_codeharbor.buttons.retry') - else - unless exported - - if !exercise_found || update_right + - if !task_found || update_right = button_tag type: 'button', class:'btn btn-primary pull-right export-action export-button', data: {exercise_id: exercise.id} do i.fa.fa-check.confirm-icon = t('exercises.export_codeharbor.buttons.export') diff --git a/spec/controllers/exercises_controller_spec.rb b/spec/controllers/exercises_controller_spec.rb index 683f0d40..e6be8986 100644 --- a/spec/controllers/exercises_controller_spec.rb +++ b/spec/controllers/exercises_controller_spec.rb @@ -353,7 +353,7 @@ describe ExercisesController do let(:post_request) { post :export_external_check, params: {id: exercise.id} } let!(:codeharbor_link) { FactoryBot.create(:codeharbor_link, user: user) } - let(:external_check_hash) { {message: message, exercise_found: true, update_right: update_right, error: error} } + let(:external_check_hash) { {message: message, task_found: true, update_right: update_right, error: error} } let(:message) { 'message' } let(:update_right) { true } let(:error) { nil }