Fix cancel_all specs

This commit is contained in:
Kamil Trzcinski 2015-10-14 19:57:20 +02:00
parent d9ece71ef0
commit 0ff8975939
3 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@
- if @ci_project && current_user && can?(current_user, :manage_builds, @project) - if @ci_project && current_user && can?(current_user, :manage_builds, @project)
.pull-left.hidden-xs .pull-left.hidden-xs
- if @all_builds.running_or_pending.any? - if @all_builds.running_or_pending.any?
= link_to 'Cancel all', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, method: :post, class: 'btn btn-danger' = link_to 'Cancel all', cancel_all_namespace_project_builds_path(@project.namespace, @project), data: { confirm: 'Are you sure?' }, class: 'btn btn-danger'
%ul.center-top-menu %ul.center-top-menu
%li{class: ('active' if @scope.nil?)} %li{class: ('active' if @scope.nil?)}

View file

@ -587,7 +587,7 @@ Gitlab::Application.routes.draw do
resources :builds, only: [:index, :show] do resources :builds, only: [:index, :show] do
collection do collection do
post :cancel_all get :cancel_all
end end
member do member do

View file

@ -47,10 +47,10 @@ describe "Builds" do
end end
end end
describe "POST /:project/builds/:id/cancel_all" do describe "GET /:project/builds/:id/cancel_all" do
before do before do
@build.run! @build.run!
visit cancel_namespace_project_build_path(@gl_project.namespace, @gl_project, @build) visit cancel_all_namespace_project_builds_path(@gl_project.namespace, @gl_project)
end end
it { expect(page).to have_content 'All' } it { expect(page).to have_content 'All' }