Commit f36fde94 authored by Rémy Coutable's avatar Rémy Coutable

Add a spec for coverage indicator in project's builds list

parent bea6aa33
Please view this file on the master branch, on stable branches it's out of date. Please view this file on the master branch, on stable branches it's out of date.
v 8.6.0 (unreleased) v 8.6.0 (unreleased)
- Add build coverage in project's builds page (Steffen Köhler)
v 8.5.0 v 8.5.0
- Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu) - Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu)
......
...@@ -3,6 +3,7 @@ Feature: Project Builds Summary ...@@ -3,6 +3,7 @@ Feature: Project Builds Summary
Given I sign in as a user Given I sign in as a user
And I own a project And I own a project
And project has CI enabled And project has CI enabled
And project has coverage enabled
And project has a recent build And project has a recent build
Scenario: I browse build details page Scenario: I browse build details page
...@@ -12,6 +13,7 @@ Feature: Project Builds Summary ...@@ -12,6 +13,7 @@ Feature: Project Builds Summary
Scenario: I browse project builds page Scenario: I browse project builds page
When I visit project builds page When I visit project builds page
Then I see coverage
Then I see button to CI Lint Then I see button to CI Lint
Scenario: I erase a build Scenario: I erase a build
......
...@@ -4,6 +4,12 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps ...@@ -4,6 +4,12 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps
include SharedBuilds include SharedBuilds
include RepoHelpers include RepoHelpers
step 'I see coverage' do
page.within('td.coverage') do
expect(page).to have_content "99.9%"
end
end
step 'I see button to CI Lint' do step 'I see button to CI Lint' do
page.within('.nav-controls') do page.within('.nav-controls') do
ci_lint_tool_link = page.find_link('CI Lint') ci_lint_tool_link = page.find_link('CI Lint')
......
...@@ -5,9 +5,13 @@ module SharedBuilds ...@@ -5,9 +5,13 @@ module SharedBuilds
@project.enable_ci @project.enable_ci
end end
step 'project has coverage enabled' do
@project.update_attribute(:build_coverage_regex, /Coverage (\d+)%/)
end
step 'project has a recent build' do step 'project has a recent build' do
@ci_commit = create(:ci_commit, project: @project, sha: @project.commit.sha) @ci_commit = create(:ci_commit, project: @project, sha: @project.commit.sha)
@build = create(:ci_build, commit: @ci_commit) @build = create(:ci_build_with_coverage, commit: @ci_commit)
end end
step 'recent build is successful' do step 'recent build is successful' do
......
...@@ -53,6 +53,10 @@ FactoryGirl.define do ...@@ -53,6 +53,10 @@ FactoryGirl.define do
tag true tag true
end end
factory :ci_build_with_coverage do
coverage 99.9
end
trait :trace do trait :trace do
after(:create) do |build, evaluator| after(:create) do |build, evaluator|
build.trace = 'BUILD TRACE' build.trace = 'BUILD TRACE'
......
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