diff options
author | Sato Hiroyuki <sathiroyuki@gmail.com> | 2013-03-04 17:50:42 +0900 |
---|---|---|
committer | Sato Hiroyuki <sathiroyuki@gmail.com> | 2013-03-04 17:50:42 +0900 |
commit | 95b826071f09f3bb63d663f2210e654609aace52 (patch) | |
tree | 8152cec4718d5d6aac128c15835e29e473379b3b | |
parent | f8009a4858fba2db871d8aecf9480021489da37c (diff) | |
download | gitlab-ce-95b826071f09f3bb63d663f2210e654609aace52.tar.gz |
Add some tests for network graph
-rw-r--r-- | features/project/network.feature | 16 | ||||
-rw-r--r-- | features/steps/project/project_network_graph.rb | 43 |
2 files changed, 55 insertions, 4 deletions
diff --git a/features/project/network.feature b/features/project/network.feature index 31ce5ad3279..a6cbd2c4781 100644 --- a/features/project/network.feature +++ b/features/project/network.feature @@ -7,3 +7,19 @@ Feature: Project Network Graph @javascript Scenario: I should see project network Then page should have network graph + And page should select "master" in select box + And page should have "master" on graph + + @javascript + Scenario: I should switch ref to "stable" + When I switch ref to "stable" + Then page should have network graph + And page should select "stable" in select box + And page should have "stable" on graph + + @javascript + Scenario: I should looking for a commit by SHA of "v2.1.0" + When I looking for a commit by SHA of "v2.1.0" + Then page should have network graph + And page should select "master" in select box + And page should have "v2.1.0" on graph diff --git a/features/steps/project/project_network_graph.rb b/features/steps/project/project_network_graph.rb index b66aadfeae2..2ca629883a9 100644 --- a/features/steps/project/project_network_graph.rb +++ b/features/steps/project/project_network_graph.rb @@ -4,16 +4,51 @@ class ProjectNetworkGraph < Spinach::FeatureSteps Then 'page should have network graph' do page.should have_content "Project Network Graph" - within ".graph" do - page.should have_content "master" - end + page.should have_selector ".graph" end - And 'I visit project "Shop" network page' do + When 'I visit project "Shop" network page' do # Stub Graph::JsonBuilder max_size to speed up test (10 commits vs. 650) Graph::JsonBuilder.stub(max_count: 10) project = Project.find_by_name("Shop") visit project_graph_path(project, "master") end + + 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 end |