summary.rb 1.2 KB
Newer Older
1 2 3 4 5 6
class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps
  include SharedAuthentication
  include SharedProject
  include SharedBuilds
  include RepoHelpers

7 8 9 10 11 12
  step 'I see coverage' do
    page.within('td.coverage') do
      expect(page).to have_content "99.9%"
    end
  end

13
  step 'I see button to CI Lint' do
14
    page.within('.nav-controls') do
15
      ci_lint_tool_link = page.find_link('CI Lint')
16 17 18
      expect(ci_lint_tool_link[:href]).to eq ci_lint_path
    end
  end
19 20 21 22 23 24 25 26

  step 'I click erase build button' do
    click_link 'Erase'
  end

  step 'recent build has been erased' do
    expect(@build.artifacts_file.exists?).to be_falsy
    expect(@build.artifacts_metadata.exists?).to be_falsy
27
    expect(@build.trace).to be_empty
28 29 30 31 32
  end

  step 'recent build summary does not have artifacts widget' do
    expect(page).to have_no_css('.artifacts')
  end
33 34

  step 'recent build summary contains information saying that build has been erased' do
35 36 37
    page.within('.erased') do
      expect(page).to have_content 'Build has been erased'
    end
38
  end
J
Josh Frye 已提交
39 40 41 42

  step 'the build count cache is updated' do
    expect(@build.project.running_or_pending_build_count).to eq @build.project.builds.running_or_pending.count(:all)
  end
43
end