Commit 0615de01 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix ci commits features specs

parent a8dd4d36
...@@ -52,3 +52,11 @@ pre.trace { ...@@ -52,3 +52,11 @@ pre.trace {
color: #777; color: #777;
} }
} }
.alert-disabled {
background: #EEE;
a {
color: #3084bb !important;
}
}
...@@ -21,7 +21,7 @@ module Ci ...@@ -21,7 +21,7 @@ module Ci
def cancel def cancel
commit.builds.running_or_pending.each(&:cancel) commit.builds.running_or_pending.each(&:cancel)
redirect_to ci_project_ref_commit_path(project, commit.ref, commit.sha) redirect_to ci_project_ref_commits_path(project, commit.ref, commit.sha)
end end
private private
......
...@@ -15,8 +15,12 @@ module Ci ...@@ -15,8 +15,12 @@ module Ci
end end
end end
def ci_commit_path(commit)
ci_project_ref_commits_path(commit.project, commit.ref, commit.sha)
end
def commit_link(commit) def commit_link(commit)
link_to(commit.short_sha, ci_project_ref_commits_path(commit.project, commit.ref, commit.sha)) link_to(commit.short_sha, ci_commit_path(commit))
end end
def truncate_first_line(message, length = 50) def truncate_first_line(message, length = 50)
......
require 'spec_helper' require 'spec_helper'
describe "Commits" do describe "Commits" do
include Ci::CommitsHelper
context "Authenticated user" do context "Authenticated user" do
before do before do
login_as :user
@project = FactoryGirl.create :ci_project @project = FactoryGirl.create :ci_project
@commit = FactoryGirl.create :ci_commit, project: @project @commit = FactoryGirl.create :ci_commit, project: @project
@build = FactoryGirl.create :ci_build, commit: @commit @build = FactoryGirl.create :ci_build, commit: @commit
login_as :user
@project.gl_project.team << [@user, :master]
end end
describe "GET /:project/commits/:sha" do describe "GET /:project/commits/:sha" do
before do before do
visit ci_project_ref_commit_path(@project, @commit.ref, @commit.sha) visit ci_commit_path(@commit)
end end
it { expect(page).to have_content @commit.sha[0..7] } it { expect(page).to have_content @commit.sha[0..7] }
...@@ -21,7 +24,7 @@ describe "Commits" do ...@@ -21,7 +24,7 @@ describe "Commits" do
describe "Cancel commit" do describe "Cancel commit" do
it "cancels commit" do it "cancels commit" do
visit ci_project_ref_commit_path(@project, @commit.ref, @commit.sha) visit ci_commit_path(@commit)
click_on "Cancel" click_on "Cancel"
expect(page).to have_content "canceled" expect(page).to have_content "canceled"
...@@ -30,7 +33,7 @@ describe "Commits" do ...@@ -30,7 +33,7 @@ describe "Commits" do
describe ".gitlab-ci.yml not found warning" do describe ".gitlab-ci.yml not found warning" do
it "does not show warning" do it "does not show warning" do
visit ci_project_ref_commit_path(@project, @commit.ref, @commit.sha) visit ci_commit_path(@commit)
expect(page).not_to have_content ".gitlab-ci.yml not found in this commit" expect(page).not_to have_content ".gitlab-ci.yml not found in this commit"
end end
...@@ -39,7 +42,7 @@ describe "Commits" do ...@@ -39,7 +42,7 @@ describe "Commits" do
@commit.push_data[:ci_yaml_file] = nil @commit.push_data[:ci_yaml_file] = nil
@commit.save @commit.save
visit ci_project_ref_commit_path(@project, @commit.ref, @commit.sha) visit ci_commit_path(@commit)
expect(page).to have_content ".gitlab-ci.yml not found in this commit" expect(page).to have_content ".gitlab-ci.yml not found in this commit"
end end
...@@ -55,7 +58,7 @@ describe "Commits" do ...@@ -55,7 +58,7 @@ describe "Commits" do
describe "GET /:project/commits/:sha" do describe "GET /:project/commits/:sha" do
before do before do
visit ci_project_ref_commit_path(@project, @commit.ref, @commit.sha) visit ci_commit_path(@commit)
end end
it { expect(page).to have_content @commit.sha[0..7] } it { expect(page).to have_content @commit.sha[0..7] }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment