2012-09-10 15:35:23 +02:00
|
|
|
class ProjectNetworkGraph < Spinach::FeatureSteps
|
2012-09-10 17:35:03 +02:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
|
2012-09-10 15:35:23 +02:00
|
|
|
Then 'page should have network graph' do
|
|
|
|
page.should have_content "Project Network Graph"
|
2013-03-04 09:50:42 +01:00
|
|
|
page.should have_selector ".graph"
|
2012-09-10 15:35:23 +02:00
|
|
|
end
|
|
|
|
|
2013-03-04 09:50:42 +01:00
|
|
|
When 'I visit project "Shop" network page' do
|
2013-03-07 07:42:30 +01:00
|
|
|
# Stub Graph max_size to speed up test (10 commits vs. 650)
|
|
|
|
Network::Graph.stub(max_count: 10)
|
2012-09-10 15:35:23 +02:00
|
|
|
|
2012-10-31 14:22:13 +01:00
|
|
|
project = Project.find_by_name("Shop")
|
2013-01-31 05:22:08 +01:00
|
|
|
visit project_graph_path(project, "master")
|
2012-09-10 15:35:23 +02:00
|
|
|
end
|
2013-03-04 09:50:42 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2013-03-07 07:42:30 +01:00
|
|
|
When 'I switch ref to "stable"' do
|
2013-03-04 09:50:42 +01:00
|
|
|
page.select 'stable', :from => 'ref'
|
2013-03-06 07:17:01 +01:00
|
|
|
sleep 2
|
2013-03-04 09:50:42 +01:00
|
|
|
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
|
|
|
|
|
2013-03-07 07:42:30 +01:00
|
|
|
When 'I looking for a commit by SHA of "v2.1.0"' do
|
2013-03-04 09:50:42 +01:00
|
|
|
within ".content .search" do
|
|
|
|
fill_in 'q', :with => '98d6492'
|
|
|
|
find('button').click
|
|
|
|
end
|
2013-03-06 07:17:01 +01:00
|
|
|
sleep 2
|
2013-03-04 09:50:42 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
And 'page should have "v2.1.0" on graph' do
|
|
|
|
within '.graph' do
|
|
|
|
page.should have_content 'v2.1.0'
|
|
|
|
end
|
|
|
|
end
|
2012-09-10 15:35:23 +02:00
|
|
|
end
|