Fix tests and few CI features
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
a30b68fe1d
commit
7f63a8787c
6 changed files with 4 additions and 36 deletions
|
@ -1,5 +1,6 @@
|
||||||
module Ci
|
module Ci
|
||||||
class ProjectsController < Ci::ApplicationController
|
class ProjectsController < Ci::ApplicationController
|
||||||
|
before_action :project
|
||||||
before_action :authenticate_user!, except: [:build, :badge]
|
before_action :authenticate_user!, except: [:build, :badge]
|
||||||
before_action :authorize_access_project!, except: [:badge]
|
before_action :authorize_access_project!, except: [:badge]
|
||||||
before_action :authorize_manage_project!, only: [:toggle_shared_runners, :dumped_yaml]
|
before_action :authorize_manage_project!, only: [:toggle_shared_runners, :dumped_yaml]
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Projects::CommitController < Projects::ApplicationController
|
||||||
@ci_commit = @project.ci_commit(@commit.sha)
|
@ci_commit = @project.ci_commit(@commit.sha)
|
||||||
@ci_commit.builds.running_or_pending.each(&:cancel)
|
@ci_commit.builds.running_or_pending.each(&:cancel)
|
||||||
|
|
||||||
redirect_to namespace_project_commit_path(project.namespace, project, commit.sha)
|
redirect_to ci_namespace_project_commit_path(project.namespace, project, commit.sha)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
Edit your
|
Edit your
|
||||||
#{link_to ".gitlab-ci.yml using web-editor", yaml_web_editor_link(@ci_project)}
|
#{link_to ".gitlab-ci.yml using web-editor", yaml_web_editor_link(@ci_project)}
|
||||||
|
|
||||||
- if @repository
|
- unless @project.empty_repo?
|
||||||
%p
|
%p
|
||||||
Paste build status image for #{@repository.root_ref} with next link
|
Paste build status image for #{@repository.root_ref} with next link
|
||||||
= link_to '#', class: 'badge-codes-toggle btn btn-default btn-xs' do
|
= link_to '#', class: 'badge-codes-toggle btn btn-default btn-xs' do
|
||||||
|
|
|
@ -465,7 +465,7 @@ Gitlab::Application.routes.draw do
|
||||||
member do
|
member do
|
||||||
get :branches
|
get :branches
|
||||||
get :ci
|
get :ci
|
||||||
post :cancel_builds
|
get :cancel_builds
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe "Builds" do
|
|
||||||
before do
|
|
||||||
@commit = FactoryGirl.create :ci_commit
|
|
||||||
@build = FactoryGirl.create :ci_build, commit: @commit
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "GET /:project/builds/:id/status.json" do
|
|
||||||
before do
|
|
||||||
get status_ci_project_build_path(@commit.project, @build), format: :json
|
|
||||||
end
|
|
||||||
|
|
||||||
it { expect(response.status).to eq(200) }
|
|
||||||
it { expect(response.body).to include(@build.sha) }
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,16 +0,0 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe "Commits" do
|
|
||||||
before do
|
|
||||||
@commit = FactoryGirl.create :ci_commit
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "GET /:project/refs/:ref_name/commits/:id/status.json" do
|
|
||||||
before do
|
|
||||||
get status_ci_project_commits_path(@commit.project, @commit.sha), format: :json
|
|
||||||
end
|
|
||||||
|
|
||||||
it { expect(response.status).to eq(200) }
|
|
||||||
it { expect(response.body).to include(@commit.sha) }
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in a new issue