Merge pull request #1266 from tsigo/cucumber_speedup
Speed up the "Project Network Graph" cucumber feature
This commit is contained in:
commit
d862ebd3b3
3 changed files with 10 additions and 5 deletions
|
@ -4,9 +4,7 @@ Feature: Project Network Graph
|
||||||
Background:
|
Background:
|
||||||
Given I signin as a user
|
Given I signin as a user
|
||||||
And I own project "Shop"
|
And I own project "Shop"
|
||||||
And I visit project "Shop" network page
|
And I visit project "Shop" network page
|
||||||
|
|
||||||
Scenario: I should see project network
|
Scenario: I should see project network
|
||||||
Then page should have network graph
|
Then page should have network graph
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,11 @@ end
|
||||||
|
|
||||||
Given /^I visit project "(.*?)" network page$/ do |arg1|
|
Given /^I visit project "(.*?)" network page$/ do |arg1|
|
||||||
project = Project.find_by_name(arg1)
|
project = Project.find_by_name(arg1)
|
||||||
|
|
||||||
|
# Stub out find_all to speed this up (10 commits vs. 650)
|
||||||
|
commits = Grit::Commit.find_all(project.repo, nil, {max_count: 10})
|
||||||
|
Grit::Commit.stub(:find_all).and_return(commits)
|
||||||
|
|
||||||
visit graph_project_path(project)
|
visit graph_project_path(project)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -67,8 +72,8 @@ end
|
||||||
Given /^page should have network graph$/ do
|
Given /^page should have network graph$/ do
|
||||||
page.should have_content "Project Network Graph"
|
page.should have_content "Project Network Graph"
|
||||||
within ".graph" do
|
within ".graph" do
|
||||||
page.should have_content "stable"
|
page.should have_content "master"
|
||||||
page.should have_content "notes_refacto..."
|
page.should have_content "scss_refactor..."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -44,3 +44,5 @@ require 'headless'
|
||||||
|
|
||||||
headless = Headless.new
|
headless = Headless.new
|
||||||
headless.start
|
headless.start
|
||||||
|
|
||||||
|
require 'cucumber/rspec/doubles'
|
||||||
|
|
Loading…
Reference in a new issue