BigW Consortium Gitlab

graph.rb 1.48 KB
Newer Older
1
class Spinach::Features::ProjectGraph < Spinach::FeatureSteps
2 3 4
  include SharedAuthentication
  include SharedProject

5
  step 'page should have graphs' do
6
    expect(page).to have_selector ".stat-graph"
7 8 9
  end

  When 'I visit project "Shop" graph page' do
10
    visit project_graph_path(project, "master")
11
  end
12 13

  step 'I visit project "Shop" commits graph page' do
14
    visit commits_project_graph_path(project, "master")
15 16
  end

17
  step 'I visit project "Shop" languages graph page' do
18
    visit languages_project_graph_path(project, "master")
19 20
  end

21
  step 'I visit project "Shop" chart page' do
22
    visit charts_project_graph_path(project, "master")
23 24
  end

25
  step 'page should have languages graphs' do
26 27
    expect(page).to have_content /Ruby 66.* %/
    expect(page).to have_content /JavaScript 22.* %/
28 29
  end

30
  step 'page should have commits graphs' do
31 32
    expect(page).to have_content "Commit statistics for master"
    expect(page).to have_content "Commits per day of month"
33
  end
34 35

  step 'I visit project "Shop" CI graph page' do
36
    visit ci_project_graph_path(project, 'master')
37 38 39 40
  end

  step 'page should have CI graphs' do
    expect(page).to have_content 'Overall'
41 42 43
    expect(page).to have_content 'Pipelines for last week'
    expect(page).to have_content 'Pipelines for last month'
    expect(page).to have_content 'Pipelines for last year'
44 45 46 47
    expect(page).to have_content 'Commit duration in minutes for last 30 commits'
  end

  def project
48
    @project ||= Project.find_by(name: "Shop")
49
  end
50
end