diff options
author | Christopher Baines <mail@cbaines.net> | 2018-04-03 08:02:17 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2018-04-03 21:58:55 +0100 |
commit | 39d3f763d3644ac8f6f7274edb11fd1dff1c1ba9 (patch) | |
tree | 971b22205a715e357fa881ef3720e1780b69c27f | |
parent | 9e622112a80f493eab53420d7dafedb9dd10a612 (diff) | |
download | govuk-mini-environment-admin-39d3f763d3644ac8f6f7274edb11fd1dff1c1ba9.tar govuk-mini-environment-admin-39d3f763d3644ac8f6f7274edb11fd1dff1c1ba9.tar.gz |
Remove some redundant views
And replace with a redirect and flash message.
-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 |