Select Git revision
Forked from
GitLab.org / GitLab FOSS
5887 commits behind the upstream repository.
-
Douwe Maan authored
This reverts commit 96bef54154e669f9a3e92c3a4bc76c0be3a52e48.
Douwe Maan authoredThis reverts commit 96bef54154e669f9a3e92c3a4bc76c0be3a52e48.
build.rb 937 B
class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps
include SharedAuthentication
include SharedProject
include SharedBuilds
include RepoHelpers
step 'I display builds badge for a master branch' do
visit build_namespace_project_badges_path(@project.namespace, @project, ref: :master, format: :svg)
end
step 'I should see a build success badge' do
expect_badge('success')
end
step 'I should see a build failed badge' do
expect_badge('failed')
end
step 'I should see a build running badge' do
expect_badge('running')
end
step 'I should see a badge that has not been cached' do
expect(page.response_headers['Cache-Control']).to include 'no-cache'
end
def expect_badge(status)
svg = Nokogiri::XML.parse(page.body)
expect(page.response_headers['Content-Type']).to include('image/svg+xml')
expect(svg.at(%Q{text:contains("#{status}")})).to be_truthy
end
end