diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-09-25 22:34:29 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-26 16:32:24 -0400 |
commit | 4252ea90c0ab757fce538af1f03ce5f6d48f7814 (patch) | |
tree | 06df6c7e45930a06a1ce3c4efdd85696bf71db42 /features | |
parent | 6b90f36f5b6ee36dede7cc33c9364ddd34e5ba6b (diff) | |
download | gitlab-ce-4252ea90c0ab757fce538af1f03ce5f6d48f7814.tar.gz |
Add feature steps for a generic, non-"Shop" project
This group is better for features that only deal with one project.
Diffstat (limited to 'features')
-rw-r--r-- | features/steps/shared/paths.rb | 48 | ||||
-rw-r--r-- | features/steps/shared/project.rb | 7 | ||||
-rw-r--r-- | features/support/env.rb | 2 |
3 files changed, 55 insertions, 2 deletions
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index bb35b8b0f8a..a1a8efd677a 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -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) diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 9b64ca59a3b..0f93d675786 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -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) diff --git a/features/support/env.rb b/features/support/env.rb index 9c6cef07298..6d49c25a8ba 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -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 |