diff --git a/app/controllers/delayed_jobs_controller.rb b/app/controllers/jobs_controller.rb similarity index 94% rename from app/controllers/delayed_jobs_controller.rb rename to app/controllers/jobs_controller.rb index 3b376e918..be162a6ef 100644 --- a/app/controllers/delayed_jobs_controller.rb +++ b/app/controllers/jobs_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class DelayedJobsController < ApplicationController +class JobsController < ApplicationController respond_to :html, :xml, :json, :js def index diff --git a/app/views/delayed_jobs/cancel.js.erb b/app/views/jobs/cancel.js.erb similarity index 100% rename from app/views/delayed_jobs/cancel.js.erb rename to app/views/jobs/cancel.js.erb diff --git a/app/views/delayed_jobs/destroy.js.erb b/app/views/jobs/destroy.js.erb similarity index 100% rename from app/views/delayed_jobs/destroy.js.erb rename to app/views/jobs/destroy.js.erb diff --git a/app/views/delayed_jobs/index.html.erb b/app/views/jobs/index.html.erb similarity index 69% rename from app/views/delayed_jobs/index.html.erb rename to app/views/jobs/index.html.erb index 5a07b6990..de28716e5 100644 --- a/app/views/delayed_jobs/index.html.erb +++ b/app/views/jobs/index.html.erb @@ -1,6 +1,6 @@ -
+
-

Delayed Jobs

+

Jobs

<%= table_for @jobs, class: "striped autofit" do |t| %> <% t.column "Name" do |job| %> @@ -29,10 +29,10 @@ <% t.column column: "control" do |job| %> <% if GoodJobPolicy.new(CurrentUser.user, job).update? %> - <%= link_to "Run", run_delayed_job_path(job), method: :put, remote: true %> | - <%= link_to "Retry", retry_delayed_job_path(job), method: :put, remote: true %> | - <%= link_to "Cancel", cancel_delayed_job_path(job), method: :put, remote: true %> | - <%= link_to "Delete", delayed_job_path(job), method: :delete, remote: true %> + <%= link_to "Run", run_job_path(job), method: :put, remote: true %> | + <%= link_to "Retry", retry_job_path(job), method: :put, remote: true %> | + <%= link_to "Cancel", cancel_job_path(job), method: :put, remote: true %> | + <%= link_to "Delete", job_path(job), method: :delete, remote: true %> <% end %> <% end %> <% end %> diff --git a/app/views/delayed_jobs/retry.js.erb b/app/views/jobs/retry.js.erb similarity index 100% rename from app/views/delayed_jobs/retry.js.erb rename to app/views/jobs/retry.js.erb diff --git a/app/views/delayed_jobs/run.js.erb b/app/views/jobs/run.js.erb similarity index 100% rename from app/views/delayed_jobs/run.js.erb rename to app/views/jobs/run.js.erb diff --git a/app/views/static/site_map.html.erb b/app/views/static/site_map.html.erb index aeed639e1..1c754e014 100644 --- a/app/views/static/site_map.html.erb +++ b/app/views/static/site_map.html.erb @@ -170,7 +170,7 @@
  • <%= link_to("News Updates", news_updates_path) %>
  • <% end %> -
  • <%= link_to("Jobs", delayed_jobs_path) %>
  • +
  • <%= link_to("Jobs", jobs_path) %>
  • diff --git a/config/routes.rb b/config/routes.rb index 78d9b5ac9..4c58ef279 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -106,7 +106,7 @@ Rails.application.routes.draw do get :posts end end - resources :delayed_jobs, :only => [:index, :destroy] do + resources :jobs, only: [:index, :destroy] do member do put :run put :retry @@ -337,6 +337,7 @@ Rails.application.routes.draw do get "/static/dtext_help" => "static#dtext_help", :as => "dtext_help" get "/static/terms_of_service", to: redirect("/terms_of_service") get "/user_upgrade/new", to: redirect("/user_upgrades/new") + get "/delayed_jobs", to: redirect("/jobs") get "/mock/recommender/recommend/:user_id" => "mock_services#recommender_recommend", as: "mock_recommender_recommend" get "/mock/recommender/similiar/:post_id" => "mock_services#recommender_similar", as: "mock_recommender_similar" diff --git a/test/functional/delayed_jobs_controller_test.rb b/test/functional/jobs_controller_test.rb similarity index 71% rename from test/functional/delayed_jobs_controller_test.rb rename to test/functional/jobs_controller_test.rb index ad5508888..387dabb5d 100644 --- a/test/functional/delayed_jobs_controller_test.rb +++ b/test/functional/jobs_controller_test.rb @@ -1,7 +1,7 @@ require 'test_helper' -class DelayedJobsControllerTest < ActionDispatch::IntegrationTest - context "The delayed jobs controller" do +class JobsControllerTest < ActionDispatch::IntegrationTest + context "The jobs controller" do setup do @user = create(:admin_user) @job = create(:good_job) @@ -9,7 +9,7 @@ class DelayedJobsControllerTest < ActionDispatch::IntegrationTest context "index action" do should "render" do - get delayed_jobs_path + get jobs_path assert_response :success end end @@ -17,7 +17,7 @@ class DelayedJobsControllerTest < ActionDispatch::IntegrationTest context "cancel action" do should "work" do GoodJob::ActiveJobJob.any_instance.stubs(:status).returns(:queued) - put_auth cancel_delayed_job_path(@job), @user, xhr: true + put_auth cancel_job_path(@job), @user, xhr: true assert_response :success end end @@ -26,7 +26,7 @@ class DelayedJobsControllerTest < ActionDispatch::IntegrationTest should "work" do @job.head_execution.active_job.class.stubs(:queue_adapter).returns(GoodJob::Adapter.new) GoodJob::ActiveJobJob.any_instance.stubs(:status).returns(:discarded) - put_auth retry_delayed_job_path(@job), @user, xhr: true + put_auth retry_job_path(@job), @user, xhr: true assert_response :success end end @@ -34,14 +34,14 @@ class DelayedJobsControllerTest < ActionDispatch::IntegrationTest context "run action" do should "work" do GoodJob::ActiveJobJob.any_instance.stubs(:status).returns(:queued) - put_auth run_delayed_job_path(@job), @user, xhr: true + put_auth run_job_path(@job), @user, xhr: true assert_response :success end end context "destroy action" do should "work" do - delete_auth delayed_job_path(@job), @user, xhr: true + delete_auth job_path(@job), @user, xhr: true assert_response :success end end