2012-09-10 13:35:23 +00:00
|
|
|
class ProjectNetworkGraph < Spinach::FeatureSteps
|
2012-09-10 15:35:03 +00:00
|
|
|
include SharedAuthentication
|
|
|
|
include SharedProject
|
|
|
|
|
2012-09-10 13:35:23 +00:00
|
|
|
Then 'page should have network graph' do
|
2013-07-15 13:18:47 +00:00
|
|
|
page.should have_selector ".network-graph"
|
2012-09-10 13:35:23 +00:00
|
|
|
end
|
|
|
|
|
2013-03-04 08:50:42 +00:00
|
|
|
When 'I visit project "Shop" network page' do
|
2013-03-07 06:42:30 +00:00
|
|
|
# Stub Graph max_size to speed up test (10 commits vs. 650)
|
|
|
|
Network::Graph.stub(max_count: 10)
|
2012-09-10 13:35:23 +00:00
|
|
|
|
2012-10-31 13:22:13 +00:00
|
|
|
project = Project.find_by_name("Shop")
|
2013-06-11 06:54:01 +00:00
|
|
|
visit project_network_path(project, "master")
|
2012-09-10 13:35:23 +00:00
|
|
|
end
|
2013-03-04 08:50:42 +00:00
|
|
|
|
|
|
|
And 'page should select "master" in select box' do
|
2013-08-08 13:14:38 +00:00
|
|
|
page.should have_selector '.chosen-single span', text: "master"
|
2013-03-04 08:50:42 +00:00
|
|
|
end
|
|
|
|
|
2013-04-14 09:15:35 +00:00
|
|
|
And 'page should select "v2.1.0" in select box' do
|
2013-08-08 13:14:38 +00:00
|
|
|
page.should have_selector '.chosen-single span', text: "v2.1.0"
|
2013-04-14 09:15:35 +00:00
|
|
|
end
|
|
|
|
|
2013-03-04 08:50:42 +00:00
|
|
|
And 'page should have "master" on graph' do
|
2013-07-15 13:18:47 +00:00
|
|
|
within '.network-graph' do
|
2013-03-04 08:50:42 +00:00
|
|
|
page.should have_content 'master'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-03-07 06:42:30 +00:00
|
|
|
When 'I switch ref to "stable"' do
|
2013-05-05 14:01:10 +00:00
|
|
|
page.select 'stable', from: 'ref'
|
2013-03-06 06:17:01 +00:00
|
|
|
sleep 2
|
2013-03-04 08:50:42 +00:00
|
|
|
end
|
|
|
|
|
2013-04-25 13:05:22 +00:00
|
|
|
When 'I switch ref to "v2.1.0"' do
|
2013-05-05 14:01:10 +00:00
|
|
|
page.select 'v2.1.0', from: 'ref'
|
2013-04-25 13:05:22 +00:00
|
|
|
sleep 2
|
|
|
|
end
|
|
|
|
|
2013-04-14 09:15:35 +00:00
|
|
|
When 'I switch ref to "v2.1.0"' do
|
|
|
|
page.select 'v2.1.0', from: 'ref'
|
|
|
|
sleep 2
|
|
|
|
end
|
|
|
|
|
|
|
|
When 'click "Show only selected branch" checkbox' do
|
|
|
|
find('#filter_ref').click
|
|
|
|
sleep 2
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'page should have content not cotaining "v2.1.0"' do
|
2013-07-15 13:18:47 +00:00
|
|
|
within '.network-graph' do
|
2013-04-14 09:15:35 +00:00
|
|
|
page.should have_content 'cleaning'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then 'page should not have content not cotaining "v2.1.0"' do
|
2013-07-15 13:18:47 +00:00
|
|
|
within '.network-graph' do
|
2013-04-14 09:15:35 +00:00
|
|
|
page.should_not have_content 'cleaning'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-03-04 08:50:42 +00:00
|
|
|
And 'page should select "stable" in select box' do
|
2013-08-08 13:14:38 +00:00
|
|
|
page.should have_selector '.chosen-single span', text: "stable"
|
2013-03-04 08:50:42 +00:00
|
|
|
end
|
|
|
|
|
2013-04-25 13:05:22 +00:00
|
|
|
And 'page should select "v2.1.0" in select box' do
|
2013-08-08 13:14:38 +00:00
|
|
|
page.should have_selector '.chosen-single span', text: "v2.1.0"
|
2013-04-25 13:05:22 +00:00
|
|
|
end
|
|
|
|
|
2013-03-04 08:50:42 +00:00
|
|
|
And 'page should have "stable" on graph' do
|
2013-07-15 13:18:47 +00:00
|
|
|
within '.network-graph' do
|
2013-03-04 08:50:42 +00:00
|
|
|
page.should have_content 'stable'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-03-07 06:42:30 +00:00
|
|
|
When 'I looking for a commit by SHA of "v2.1.0"' do
|
2013-03-04 08:50:42 +00:00
|
|
|
within ".content .search" do
|
2013-08-21 10:20:29 +00:00
|
|
|
fill_in 'extended_sha1', with: '98d6492'
|
2013-03-04 08:50:42 +00:00
|
|
|
find('button').click
|
|
|
|
end
|
2013-03-06 06:17:01 +00:00
|
|
|
sleep 2
|
2013-03-04 08:50:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
And 'page should have "v2.1.0" on graph' do
|
2013-07-15 13:18:47 +00:00
|
|
|
within '.network-graph' do
|
2013-03-04 08:50:42 +00:00
|
|
|
page.should have_content 'v2.1.0'
|
|
|
|
end
|
|
|
|
end
|
2013-08-21 07:55:18 +00:00
|
|
|
|
|
|
|
When 'I look for a commit by ";"' do
|
|
|
|
within ".content .search" do
|
2013-08-21 10:20:29 +00:00
|
|
|
fill_in 'extended_sha1', with: ';'
|
2013-08-21 07:55:18 +00:00
|
|
|
find('button').click
|
|
|
|
end
|
|
|
|
end
|
2012-09-10 13:35:23 +00:00
|
|
|
end
|