diff options
-rw-r--r-- | app/controllers/que_jobs_controller.rb | 8 | ||||
-rw-r--r-- | app/views/que_jobs/cancel.html.erb | 2 | ||||
-rw-r--r-- | app/views/que_jobs/retry_now.html.erb | 2 | ||||
-rw-r--r-- | test/controllers/que_jobs_controller_test.rb | 4 |
4 files changed, 10 insertions, 6 deletions
diff --git a/app/controllers/que_jobs_controller.rb b/app/controllers/que_jobs_controller.rb index bab2c47..34ac201 100644 --- a/app/controllers/que_jobs_controller.rb +++ b/app/controllers/que_jobs_controller.rb @@ -3,6 +3,10 @@ class QueJobsController < ApplicationController ActiveRecord::Base.connection.execute( "DELETE FROM que_jobs WHERE job_id = #{job_id}::bigint" ) + + flash[:success] = 'Job canceled' + + redirect_to mini_environments_path end def retry_now @@ -11,6 +15,10 @@ class QueJobsController < ApplicationController SET run_at = now() WHERE job_id = #{job_id}::bigint" ) + + flash[:success] = 'Retrying the job now' + + redirect_to mini_environments_path end def job_id diff --git a/app/views/que_jobs/cancel.html.erb b/app/views/que_jobs/cancel.html.erb deleted file mode 100644 index 5886237..0000000 --- a/app/views/que_jobs/cancel.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<h1>QueJobs#cancel</h1> -<p>Find me in app/views/que_jobs/cancel.html.erb</p> diff --git a/app/views/que_jobs/retry_now.html.erb b/app/views/que_jobs/retry_now.html.erb deleted file mode 100644 index 1c8ecee..0000000 --- a/app/views/que_jobs/retry_now.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<h1>QueJobs#retry_now</h1> -<p>Find me in app/views/que_jobs/retry_now.html.erb</p> diff --git a/test/controllers/que_jobs_controller_test.rb b/test/controllers/que_jobs_controller_test.rb index f5821e3..9cab867 100644 --- a/test/controllers/que_jobs_controller_test.rb +++ b/test/controllers/que_jobs_controller_test.rb @@ -10,7 +10,7 @@ class QueJobsControllerTest < ActionDispatch::IntegrationTest post cancel_que_job_path(job.attrs['job_id']) - assert_response :success + assert_response :redirect end test 'retry now' do @@ -18,6 +18,6 @@ class QueJobsControllerTest < ActionDispatch::IntegrationTest post retry_now_que_job_path(job.attrs['job_id']) - assert_response :success + assert_response :redirect end end |