Skip to content
Snippets Groups Projects
Unverified Commit 7f63a878 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix tests and few CI features

parent a30b68fe
No related branches found
No related tags found
No related merge requests found
module Ci
class ProjectsController < Ci::ApplicationController
before_action :project
before_action :authenticate_user!, except: [:build, :badge]
before_action :authorize_access_project!, except: [:badge]
before_action :authorize_manage_project!, only: [:toggle_shared_runners, :dumped_yaml]
Loading
Loading
Loading
Loading
@@ -42,7 +42,7 @@ class Projects::CommitController < Projects::ApplicationController
@ci_commit = @project.ci_commit(@commit.sha)
@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
 
 
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@
Edit your
#{link_to ".gitlab-ci.yml using web-editor", yaml_web_editor_link(@ci_project)}
 
- if @repository
- unless @project.empty_repo?
%p
Paste build status image for #{@repository.root_ref} with next link
= link_to '#', class: 'badge-codes-toggle btn btn-default btn-xs' do
Loading
Loading
Loading
Loading
@@ -465,7 +465,7 @@ Gitlab::Application.routes.draw do
member do
get :branches
get :ci
post :cancel_builds
get :cancel_builds
end
end
 
Loading
Loading
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment