<% if job.nil? %>
- Error
@@ -17,9 +17,9 @@
<% else %>
- <%= link_to "Retry", retry_failure_path(:queue=>failure_queue,:id=>id), :method => :put %>
+ <%= link_to "Retry", retry_failure_path(:queue=>failure_queue,:id=>id), :data => {'job-id' => id }, :method => :put, :class => 'retry' %>
or
- <%= link_to "Remove", failure_path(:queue=>failure_queue,:id=>id), :method => :delete %>
+ <%= link_to "Remove", failure_path(:queue=>failure_queue,:id=>id), :data => {'job-id' => id }, :method => :delete, :class => 'remove' %>
<% end %>
diff --git a/app/views/resque_web/failures/index.html.erb b/app/views/resque_web/failures/index.html.erb
index 0217a96..982f5e3 100644
--- a/app/views/resque_web/failures/index.html.erb
+++ b/app/views/resque_web/failures/index.html.erb
@@ -3,7 +3,6 @@
<% else %>
Failed Jobs <%= "on '#{params[:queue]}'" if params[:queue] %> <%= "with class '#{params[:class]}'" if params[:class] %>
<% end %>
-
<% unless failure_size.zero? %>
<%= form_tag(destroy_all_failures_path(queue: params[:queue]), method: :delete) do %>
<%= submit_tag "Clear #{failure_queue_name} Jobs", class: 'btn btn-danger', data: { confirm: "Are you sure you want to clear ALL #{failure_queue_name.downcase} jobs?" } %>
@@ -21,7 +20,6 @@
<%= render partial: 'overview' %>
<% else %>
Showing <%= failure_start_at %> to <%= failure_end_at %> of <%= failure_size %> jobs
-
<% each_failure do |id, job| %>
<%= render partial: 'failed_job', locals: { id: id, job: job } %>
@@ -30,3 +28,45 @@
<%= pagination(start: failure_start_at, total: failure_size) unless params[:class] %>
<% end %>
+
+
diff --git a/test/functional/failures_controller_test.rb b/test/functional/failures_controller_test.rb
index ee255c2..28762a3 100644
--- a/test/functional/failures_controller_test.rb
+++ b/test/functional/failures_controller_test.rb
@@ -19,7 +19,7 @@ class FailuresControllerTest < ActionController::TestCase
it "deletes the failure" do
Resque::Failure.expects(:remove).with('123')
visit(:destroy, {:id => 123}, :method => :delete)
- assert_redirected_to failures_path
+ assert_response(:success, '{success: true}')
end
end