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
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)
......
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)
......
......@@ -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
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