Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-02-08 14:42:35 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-02-11 12:29:14 +0300
commit29f2600ab6b04d95c7ef4fbfea7c4c9ecf638e97 (patch)
tree4e9b93744fda798dd661e8cdd51f0f97c293da0f /features/steps
parentcf0eab504772c05b067ca60f78bc76779342c912 (diff)
Improve build badge tests, add another test case
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/project/builds/badge.rb13
-rw-r--r--features/steps/shared/builds.rb4
2 files changed, 13 insertions, 4 deletions
diff --git a/features/steps/project/builds/badge.rb b/features/steps/project/builds/badge.rb
index 3cf1e2cab5e..0ceb4ddcd25 100644
--- a/features/steps/project/builds/badge.rb
+++ b/features/steps/project/builds/badge.rb
@@ -8,18 +8,23 @@ class Spinach::Features::ProjectBuildsBadge < Spinach::FeatureSteps
end
step 'I should see a build success badge' do
- expect(svg.at('text:contains("success")')).to be_truthy
+ expect_badge('success')
end
step 'I should see a build failed badge' do
- expect(svg.at('text:contains("failed")')).to be_truthy
+ expect_badge('failed')
end
- step 'build badge is a svg image' do
- expect(page.response_headers).to include('Content-Type' => 'image/svg+xml')
+ step 'I should see a build running badge' do
+ expect_badge('running')
end
def svg
Nokogiri::HTML.parse(page.body)
end
+
+ def expect_badge(status)
+ expect(page.response_headers).to include('Content-Type' => 'image/svg+xml')
+ expect(svg.at(%Q{text:contains("#{status}")})).to be_truthy
+ end
end
diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb
index 055ebe1c815..7e1d9bb4056 100644
--- a/features/steps/shared/builds.rb
+++ b/features/steps/shared/builds.rb
@@ -18,6 +18,10 @@ module SharedBuilds
@build.update_column(:status, 'failed')
end
+ step 'project has an another build that is running' do
+ create(:ci_build, commit: @ci_commit, name: 'second build', status: 'running')
+ end
+
step 'I visit recent build details page' do
visit namespace_project_build_path(@project.namespace, @project, @build)
end