Commit 17dfcf6d authored by Lin Jen-Shin's avatar Lin Jen-Shin

Add a test for showing correct pipeline

parent 5416d0e0
......@@ -12,11 +12,15 @@ describe 'Commits' do
end
let!(:pipeline) do
FactoryGirl.create :ci_pipeline, project: project, sha: project.commit.sha
create(:ci_pipeline,
project: project,
ref: project.default_branch,
sha: project.commit.sha,
status: :success)
end
context 'commit status is Generic Commit Status' do
let!(:status) { FactoryGirl.create :generic_commit_status, pipeline: pipeline }
let!(:status) { create(:generic_commit_status, pipeline: pipeline) }
before do
project.team << [@user, :reporter]
......@@ -39,7 +43,7 @@ describe 'Commits' do
end
context 'commit status is Ci Build' do
let!(:build) { FactoryGirl.create :ci_build, pipeline: pipeline }
let!(:build) { create(:ci_build, pipeline: pipeline) }
let(:artifacts_file) { fixture_file_upload(Rails.root + 'spec/fixtures/banana_sample.gif', 'image/gif') }
context 'when logged as developer' do
......@@ -48,13 +52,22 @@ describe 'Commits' do
end
describe 'Project commits' do
let!(:pipeline_from_other_branch) do
create(:ci_pipeline,
project: project,
ref: 'fix',
sha: project.commit.sha,
status: :failed)
end
before do
visit namespace_project_commits_path(project.namespace, project, :master)
end
it 'shows build status' do
it 'shows correct build status from default branch' do
page.within("//li[@id='commit-#{pipeline.short_sha}']") do
expect(page).to have_css(".ci-status-link")
expect(page).to have_css('.ci-status-link')
expect(page).to have_css('.ci-status-icon-success')
end
end
end
......
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