graph.rb 1.2 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
V
Vinnie Okada 已提交
10
    visit namespace_project_graph_path(project.namespace, project, "master")
11
  end
12 13

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

  step 'page should have commits graphs' do
18 19
    expect(page).to have_content "Commit statistics for master"
    expect(page).to have_content "Commits per day of month"
20
  end
21 22 23 24 25 26 27

  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'
28 29 30
    expect(page).to have_content 'Builds for last week'
    expect(page).to have_content 'Builds for last month'
    expect(page).to have_content 'Builds for last year'
31 32 33 34
    expect(page).to have_content 'Commit duration in minutes for last 30 commits'
  end

  def project
35
    @project ||= Project.find_by(name: "Shop")
36
  end
37
end