project_network_graph.rb 1.36 KB
Newer Older
1
class ProjectNetworkGraph < Spinach::FeatureSteps
Nihad Abbasov's avatar
Nihad Abbasov committed
2 3 4
  include SharedAuthentication
  include SharedProject

5 6
  Then 'page should have network graph' do
    page.should have_content "Project Network Graph"
7
    page.should have_selector ".graph"
8 9
  end

10
  When 'I visit project "Shop" network page' do
randx's avatar
randx committed
11
    # Stub Graph::JsonBuilder max_size to speed up test (10 commits vs. 650)
Sato Hiroyuki's avatar
Sato Hiroyuki committed
12
    Graph::JsonBuilder.stub(max_count: 10)
13

14
    project = Project.find_by_name("Shop")
Sato Hiroyuki's avatar
Sato Hiroyuki committed
15
    visit project_graph_path(project, "master")
16
  end
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53

  And 'page should select "master" in select box' do
    page.should have_selector '#ref_chzn span', :text => "master"
  end

  And 'page should have "master" on graph' do
    within '.graph' do
      page.should have_content 'master'
    end
  end

  And 'I switch ref to "stable"' do
    page.select 'stable', :from => 'ref'
  end

  And 'page should select "stable" in select box' do
    page.should have_selector '#ref_chzn span', :text => "stable"
  end

  And 'page should have "stable" on graph' do
    within '.graph' do
      page.should have_content 'stable'
    end
  end

  And 'I looking for a commit by SHA of "v2.1.0"' do
    within ".content .search" do
      fill_in 'q', :with => '98d6492'
      find('button').click
    end
  end

  And 'page should have "v2.1.0" on graph' do
    within '.graph' do
      page.should have_content 'v2.1.0'
    end
  end
54
end