BigW Consortium Gitlab

graph.rb 1.47 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
Vinnie Okada committed
10
    visit namespace_project_graph_path(project.namespace, project, "master")
11
  end
12 13

  step 'I visit project "Shop" commits graph page' do
Vinnie Okada committed
14
    visit commits_namespace_project_graph_path(project.namespace, project, "master")
15 16
  end

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

  step 'page should have languages graphs' do
22 23
    expect(page).to have_content /Ruby 66.* %/
    expect(page).to have_content /JavaScript 22.* %/
24 25
  end

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

  step 'I visit project "Shop" CI graph page' do
    visit ci_namespace_project_graph_path(project.namespace, project, 'master')
  end

  step 'page should have CI graphs' do
    expect(page).to have_content 'Overall'
Filipa Lacerda committed
37 38 39
    expect(page).to have_content 'Jobs for last week'
    expect(page).to have_content 'Jobs for last month'
    expect(page).to have_content 'Jobs for last year'
40 41 42 43
    expect(page).to have_content 'Commit duration in minutes for last 30 commits'
  end

  def project
44
    @project ||= Project.find_by(name: "Shop")
45
  end
46
end