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:
Diffstat (limited to 'features/steps/project/builds/badge.rb')
-rw-r--r--features/steps/project/builds/badge.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/features/steps/project/builds/badge.rb b/features/steps/project/builds/badge.rb
new file mode 100644
index 00000000000..3cf1e2cab5e
--- /dev/null
+++ b/features/steps/project/builds/badge.rb
@@ -0,0 +1,25 @@
+class Spinach::Features::ProjectBuildsBadge < Spinach::FeatureSteps
+ include SharedProject
+ include SharedBuilds
+ include RepoHelpers
+
+ step 'I display builds badge for a master branch' do
+ visit badge_namespace_project_builds_path(@project.namespace, @project, ref: :master, format: :svg)
+ end
+
+ step 'I should see a build success badge' do
+ expect(svg.at('text:contains("success")')).to be_truthy
+ end
+
+ step 'I should see a build failed badge' do
+ expect(svg.at('text:contains("failed")')).to be_truthy
+ end
+
+ step 'build badge is a svg image' do
+ expect(page.response_headers).to include('Content-Type' => 'image/svg+xml')
+ end
+
+ def svg
+ Nokogiri::HTML.parse(page.body)
+ end
+end