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

badge.rb « builds « project « steps « features - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0ceb4ddcd25d9442e7280a617e983d8f031eb8ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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_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

  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