delayed jobs: fix exception on index page.

This commit is contained in:
evazion
2020-03-30 12:36:06 -05:00
parent 353c2e4bae
commit 83c2abf1ae
3 changed files with 7 additions and 1 deletions

View File

@@ -24,7 +24,7 @@
<%= time_ago_in_words_tagged(job.run_at) %>
<% end %>
<% t.column column: "control" do |job| %>
<% if policy(job).update? %>
<% if DelayedJobPolicy.new([CurrentUser.user, request], job).update? %>
<% if job.locked_at? %>
Running
<% elsif job.failed? %>

View File

@@ -0,0 +1,5 @@
FactoryBot.define do
factory :delayed_job, class: Delayed::Job do
handler { "" }
end
end

View File

@@ -4,6 +4,7 @@ class DelayedJobsControllerTest < ActionDispatch::IntegrationTest
context "The delayed jobs controller" do
context "index action" do
should "render" do
create(:delayed_job)
get delayed_jobs_path
assert_response :success
end