Commit 4252ea90 authored by Robert Speicher's avatar Robert Speicher

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

This group is better for features that only deal with one project.
parent 6b90f36f
module SharedPaths module SharedPaths
include Spinach::DSL include Spinach::DSL
When 'I visit new project page' do
visit new_project_path
end
# ---------------------------------------- # ----------------------------------------
# Dashboard # Dashboard
# ---------------------------------------- # ----------------------------------------
...@@ -81,10 +85,50 @@ module SharedPaths ...@@ -81,10 +85,50 @@ module SharedPaths
visit admin_resque_path visit admin_resque_path
end 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 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 And 'I visit project "Shop" page' do
project = Project.find_by_name("Shop") project = Project.find_by_name("Shop")
visit project_path(project) visit project_path(project)
......
module SharedProject module SharedProject
include Spinach::DSL 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 And 'I own project "Shop"' do
@project = Factory :project, :name => "Shop" @project = Factory :project, :name => "Shop"
@project.add_access(@user, :admin) @project.add_access(@user, :admin)
......
...@@ -23,5 +23,7 @@ Spinach.hooks.after_scenario { DatabaseCleaner.clean } ...@@ -23,5 +23,7 @@ Spinach.hooks.after_scenario { DatabaseCleaner.clean }
Spinach.hooks.before_run do Spinach.hooks.before_run do
RSpec::Mocks::setup self RSpec::Mocks::setup self
include FactoryGirl::Syntax::Methods
stub_gitolite! stub_gitolite!
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment