delayed jobs: fix exception on index page.
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
<%= time_ago_in_words_tagged(job.run_at) %>
|
<%= time_ago_in_words_tagged(job.run_at) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% t.column column: "control" do |job| %>
|
<% t.column column: "control" do |job| %>
|
||||||
<% if policy(job).update? %>
|
<% if DelayedJobPolicy.new([CurrentUser.user, request], job).update? %>
|
||||||
<% if job.locked_at? %>
|
<% if job.locked_at? %>
|
||||||
Running
|
Running
|
||||||
<% elsif job.failed? %>
|
<% elsif job.failed? %>
|
||||||
|
|||||||
5
test/factories/delayed_job.rb
Normal file
5
test/factories/delayed_job.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FactoryBot.define do
|
||||||
|
factory :delayed_job, class: Delayed::Job do
|
||||||
|
handler { "" }
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -4,6 +4,7 @@ class DelayedJobsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
context "The delayed jobs controller" do
|
context "The delayed jobs controller" do
|
||||||
context "index action" do
|
context "index action" do
|
||||||
should "render" do
|
should "render" do
|
||||||
|
create(:delayed_job)
|
||||||
get delayed_jobs_path
|
get delayed_jobs_path
|
||||||
assert_response :success
|
assert_response :success
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user