Add feature steps for a generic, non-"Shop" project

This group is better for features that only deal with one project.
This commit is contained in:
Robert Speicher 2012-09-25 22:34:29 -04:00
parent 6b90f36f5b
commit 4252ea90c0
3 changed files with 55 additions and 2 deletions

View file

@ -1,6 +1,10 @@
module SharedPaths
include Spinach::DSL
When 'I visit new project page' do
visit new_project_path
end
# ----------------------------------------
# Dashboard
# ----------------------------------------
@ -81,10 +85,50 @@ module SharedPaths
visit admin_resque_path
end
When 'I visit new project page' do
visit new_project_path
# ----------------------------------------
# Generic Project
# ----------------------------------------
Given "I visit my project's home page" do
visit project_path(@project)
end
Given "I visit my project's files page" do
visit project_tree_path(@project, @project.root_ref)
end
Given "I visit my project's commits page" do
visit project_commits_path(@project, @project.root_ref, {limit: 5})
end
Given "I visit my project's network page" do
# 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)
end
Given "I visit my project's issues page" do
visit project_issues_path(@project)
end
Given "I visit my project's merge requests page" do
visit project_merge_requests_path(@project)
end
Given "I visit my project's wall page" do
visit wall_project_path(@project)
end
Given "I visit my project's wiki page" do
visit project_wiki_path(@project, :index)
end
# ----------------------------------------
# "Shop" Project
# ----------------------------------------
And 'I visit project "Shop" page' do
project = Project.find_by_name("Shop")
visit project_path(project)

View file

@ -1,6 +1,13 @@
module SharedProject
include Spinach::DSL
# Create a project without caring about what it's called
And "I own a project" do
@project = create(:project)
@project.add_access(@user, :admin)
end
# Create a specific project called "Shop"
And 'I own project "Shop"' do
@project = Factory :project, :name => "Shop"
@project.add_access(@user, :admin)

View file

@ -23,5 +23,7 @@ Spinach.hooks.after_scenario { DatabaseCleaner.clean }
Spinach.hooks.before_run do
RSpec::Mocks::setup self
include FactoryGirl::Syntax::Methods
stub_gitolite!
end