summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--features/project/create_project.feature2
-rw-r--r--features/project/wall.feature6
-rw-r--r--features/steps/dashboard/dashboard.rb (renamed from features/steps/dashboard.rb)11
-rw-r--r--features/steps/dashboard/dashboard_issues.rb (renamed from features/steps/dashboard_issues.rb)21
-rw-r--r--features/steps/dashboard/dashboard_merge_requests.rb (renamed from features/steps/dashboard_merge_requests.rb)20
-rw-r--r--features/steps/dashboard/dashboard_search.rb (renamed from features/steps/dashboard_search.rb)11
-rw-r--r--features/steps/profile/profile.rb (renamed from features/steps/profile.rb)17
-rw-r--r--features/steps/profile/profile_ssh_keys.rb (renamed from features/steps/profile_ssh_keys.rb)6
-rw-r--r--features/steps/project.rb15
-rw-r--r--features/steps/project/create_project.rb (renamed from features/steps/create_project.rb)11
-rw-r--r--features/steps/project/project.rb5
-rw-r--r--features/steps/project/project_browse_branches.rb (renamed from features/steps/project_browse_branches.rb)17
-rw-r--r--features/steps/project/project_browse_commits.rb (renamed from features/steps/project_browse_commits.rb)21
-rw-r--r--features/steps/project/project_browse_files.rb (renamed from features/steps/project_browse_files.rb)25
-rw-r--r--features/steps/project/project_browse_git_repo.rb (renamed from features/steps/project_browse_git_repo.rb)17
-rw-r--r--features/steps/project/project_browse_tags.rb10
-rw-r--r--features/steps/project/project_comment_commit.rb6
-rw-r--r--features/steps/project/project_issues.rb (renamed from features/steps/project_issues.rb)40
-rw-r--r--features/steps/project/project_labels.rb (renamed from features/steps/project_labels.rb)17
-rw-r--r--features/steps/project/project_merge_requests.rb (renamed from features/steps/project_merge_requests.rb)32
-rw-r--r--features/steps/project/project_milestones.rb (renamed from features/steps/project_milestones.rb)22
-rw-r--r--features/steps/project/project_network_graph.rb (renamed from features/steps/project_network_graph.rb)12
-rw-r--r--features/steps/project/project_team_management.rb (renamed from features/steps/project_team_management.rb)17
-rw-r--r--features/steps/project/project_wall.rb6
-rw-r--r--features/steps/project/project_wiki.rb20
-rw-r--r--features/steps/project_browse_tags.rb19
-rw-r--r--features/steps/project_comment_commit.rb23
-rw-r--r--features/steps/project_wall.rb24
-rw-r--r--features/steps/project_wiki.rb37
-rw-r--r--features/steps/shared/authentication.rb10
-rw-r--r--features/steps/shared/note.rb21
-rw-r--r--features/steps/shared/paths.rb112
-rw-r--r--features/steps/shared/project.rb8
-rw-r--r--features/support/env.rb5
34 files changed, 270 insertions, 376 deletions
diff --git a/features/project/create_project.feature b/features/project/create_project.feature
index 42d25b3f331..b7cdfdb818e 100644
--- a/features/project/create_project.feature
+++ b/features/project/create_project.feature
@@ -4,7 +4,7 @@ Feature: Create Project
Should be able to create a new one
Scenario: User create a project
- Given I signin as a user
+ Given I sign in as a user
When I visit new project page
And fill project form with valid data
Then I should see project page
diff --git a/features/project/wall.feature b/features/project/wall.feature
index c92dbf82db5..c38d046a850 100644
--- a/features/project/wall.feature
+++ b/features/project/wall.feature
@@ -1,11 +1,9 @@
-@javascript
Feature: Project Wall
In order to use Project Wall
- A user
- Should be able to read & write messages
+ A user should be able to read and write messages
Background:
- Given I signin as a user
+ Given I sign in as a user
And I own project "Shop"
And I visit project "Shop" wall page
diff --git a/features/steps/dashboard.rb b/features/steps/dashboard/dashboard.rb
index e69686b32b4..6c603bbea55 100644
--- a/features/steps/dashboard.rb
+++ b/features/steps/dashboard/dashboard.rb
@@ -1,4 +1,7 @@
class Dashboard < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+
Then 'I should see "New Project" link' do
page.should have_link "New Project"
end
@@ -38,10 +41,6 @@ class Dashboard < Spinach::FeatureSteps
)
end
- When 'I visit dashboard page' do
- visit dashboard_path
- end
-
Then 'I should see "John Doe joined project Shop" event' do
page.should have_content "John Doe joined project Shop"
end
@@ -60,10 +59,6 @@ class Dashboard < Spinach::FeatureSteps
page.should have_content "John Doe left project Shop"
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
And 'I own project "Shop"' do
@project = Factory :project, :name => 'Shop'
@project.add_access(@user, :admin)
diff --git a/features/steps/dashboard_issues.rb b/features/steps/dashboard/dashboard_issues.rb
index 8704d2efdf6..9368782bf99 100644
--- a/features/steps/dashboard_issues.rb
+++ b/features/steps/dashboard/dashboard_issues.rb
@@ -1,4 +1,7 @@
class DashboardIssues < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+
Then 'I should see issues assigned to me' do
issues = @user.issues
issues.each do |issue|
@@ -7,26 +10,10 @@ class DashboardIssues < Spinach::FeatureSteps
end
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
And 'I have assigned issues' do
project = Factory :project
project.add_access(@user, :read, :write)
- issue1 = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project
-
- issue2 = Factory :issue,
- :author => @user,
- :assignee => @user,
- :project => project
- end
-
- And 'I visit dashboard issues page' do
- visit dashboard_issues_path
+ 2.times { Factory :issue, :author => @user, :assignee => @user, :project => project }
end
end
diff --git a/features/steps/dashboard_merge_requests.rb b/features/steps/dashboard/dashboard_merge_requests.rb
index 3e057ef9109..fc339e756d8 100644
--- a/features/steps/dashboard_merge_requests.rb
+++ b/features/steps/dashboard/dashboard_merge_requests.rb
@@ -1,4 +1,7 @@
class DashboardMergeRequests < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+
Then 'I should see my merge requests' do
merge_requests = @user.merge_requests
merge_requests.each do |mr|
@@ -7,10 +10,6 @@ class DashboardMergeRequests < Spinach::FeatureSteps
end
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
And 'I have authored merge requests' do
project1 = Factory :project
project2 = Factory :project
@@ -18,16 +17,7 @@ class DashboardMergeRequests < Spinach::FeatureSteps
project1.add_access(@user, :read, :write)
project2.add_access(@user, :read, :write)
- merge_request1 = Factory :merge_request,
- :author => @user,
- :project => project1
-
- merge_request2 = Factory :merge_request,
- :author => @user,
- :project => project2
- end
-
- And 'I visit dashboard merge requests page' do
- visit dashboard_merge_requests_path
+ merge_request1 = Factory :merge_request, :author => @user, :project => project1
+ merge_request2 = Factory :merge_request, :author => @user, :project => project2
end
end
diff --git a/features/steps/dashboard_search.rb b/features/steps/dashboard/dashboard_search.rb
index 122774fc23c..e35858985d6 100644
--- a/features/steps/dashboard_search.rb
+++ b/features/steps/dashboard/dashboard_search.rb
@@ -1,4 +1,7 @@
class DashboardSearch < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+
Given 'I search for "Sho"' do
fill_in "dashboard_search", :with => "Sho"
click_button "Search"
@@ -8,16 +11,8 @@ class DashboardSearch < Spinach::FeatureSteps
page.should have_link "Shop"
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
And 'I own project "Shop"' do
@project = Factory :project, :name => "Shop"
@project.add_access(@user, :admin)
end
-
- And 'I visit dashboard search page' do
- visit search_path
- end
end
diff --git a/features/steps/profile.rb b/features/steps/profile/profile.rb
index c7e6be3fdea..d3261a16690 100644
--- a/features/steps/profile.rb
+++ b/features/steps/profile/profile.rb
@@ -1,7 +1,6 @@
class Profile < Spinach::FeatureSteps
- Given 'I visit profile page' do
- visit profile_path
- end
+ include SharedAuthentication
+ include SharedPaths
Then 'I should see my profile info' do
page.should have_content "Profile"
@@ -23,10 +22,6 @@ class Profile < Spinach::FeatureSteps
@user.twitter.should == 'testtwitter'
end
- Given 'I visit profile password page' do
- visit profile_password_path
- end
-
Then 'I change my password' do
fill_in "user_password", :with => "222333"
fill_in "user_password_confirmation", :with => "222333"
@@ -37,10 +32,6 @@ class Profile < Spinach::FeatureSteps
current_path.should == new_user_session_path
end
- Given 'I visit profile token page' do
- visit profile_token_path
- end
-
Then 'I reset my token' do
@old_token = @user.private_token
click_button "Reset"
@@ -50,8 +41,4 @@ class Profile < Spinach::FeatureSteps
find("#token").value.should_not == @old_token
find("#token").value.should == @user.reload.private_token
end
-
- Given 'I sign in as a user' do
- login_as :user
- end
end
diff --git a/features/steps/profile_ssh_keys.rb b/features/steps/profile/profile_ssh_keys.rb
index 9360f66f766..96df2d7342f 100644
--- a/features/steps/profile_ssh_keys.rb
+++ b/features/steps/profile/profile_ssh_keys.rb
@@ -1,4 +1,6 @@
class ProfileSshKeys < Spinach::FeatureSteps
+ include SharedAuthentication
+
Then 'I should see my ssh keys' do
@user.keys.each do |key|
page.should have_content(key.title)
@@ -40,10 +42,6 @@ class ProfileSshKeys < Spinach::FeatureSteps
end
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
And 'I have ssh key "ssh-rsa Work"' do
Factory :key, :user => @user, :title => "ssh-rsa Work", :key => "jfKLJDFKSFJSHFJssh-rsa Work"
end
diff --git a/features/steps/project.rb b/features/steps/project.rb
deleted file mode 100644
index 666a65fadc4..00000000000
--- a/features/steps/project.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-class Projects < Spinach::FeatureSteps
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
- And 'I visit project "Shop" page' do
- project = Project.find_by_name("Shop")
- visit project_path(project)
- end
-end
diff --git a/features/steps/create_project.rb b/features/steps/project/create_project.rb
index 80f6f7088ec..6d2ca3f9b56 100644
--- a/features/steps/create_project.rb
+++ b/features/steps/project/create_project.rb
@@ -1,11 +1,6 @@
class CreateProject < Spinach::FeatureSteps
- Given 'I signin as a user' do
- login_as :user
- end
-
- When 'I visit new project page' do
- visit new_project_path
- end
+ include SharedAuthentication
+ include SharedPaths
And 'fill project form with valid data' do
fill_in 'project_name', :with => 'NewProject'
@@ -16,7 +11,7 @@ class CreateProject < Spinach::FeatureSteps
Then 'I should see project page' do
current_path.should == project_path(Project.last)
- page.should have_content('NewProject')
+ page.should have_content "NewProject"
end
And 'I should see empty project instuctions' do
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
new file mode 100644
index 00000000000..f33f12eb0a8
--- /dev/null
+++ b/features/steps/project/project.rb
@@ -0,0 +1,5 @@
+class Projects < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+end
diff --git a/features/steps/project_browse_branches.rb b/features/steps/project/project_browse_branches.rb
index 9fb2e59ddff..2f6e185deea 100644
--- a/features/steps/project_browse_branches.rb
+++ b/features/steps/project/project_browse_branches.rb
@@ -1,4 +1,8 @@
class ProjectBrowseBranches < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+
Then 'I should see "Shop" recent branches list' do
page.should have_content "Branches"
page.should have_content "master"
@@ -24,21 +28,8 @@ class ProjectBrowseBranches < Spinach::FeatureSteps
end
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
And 'project "Shop" has protected branches' do
project = Project.find_by_name("Shop")
project.protected_branches.create(:name => "stable")
end
-
- Given 'I visit project branches page' do
- visit branches_project_repository_path(@project)
- end
end
diff --git a/features/steps/project_browse_commits.rb b/features/steps/project/project_browse_commits.rb
index 71c592a7b57..014799879e8 100644
--- a/features/steps/project_browse_commits.rb
+++ b/features/steps/project/project_browse_commits.rb
@@ -1,4 +1,8 @@
class ProjectBrowseCommits < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+
Then 'I see project commits' do
current_path.should == project_commits_path(@project)
@@ -29,10 +33,6 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
page.should have_content "Showing 1 changed file"
end
- Given 'I visit compare refs page' do
- visit compare_project_commits_path(@project)
- end
-
And 'I fill compare fields with refs' do
fill_in "from", :with => "master"
fill_in "to", :with => "stable"
@@ -44,17 +44,4 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
page.should have_content "Compare View"
page.should have_content "Showing 73 changed files"
end
-
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
- Given 'I visit project commits page' do
- visit project_commits_path(@project)
- end
end
diff --git a/features/steps/project_browse_files.rb b/features/steps/project/project_browse_files.rb
index ad320584567..67c553ced40 100644
--- a/features/steps/project_browse_files.rb
+++ b/features/steps/project/project_browse_files.rb
@@ -1,14 +1,14 @@
class ProjectBrowseFiles < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+
Then 'I should see files from repository' do
page.should have_content "app"
page.should have_content "History"
page.should have_content "Gemfile"
end
- Given 'I visit project source page for "8470d70"' do
- visit tree_project_ref_path(@project, "8470d70")
- end
-
Then 'I should see files from repository for "8470d70"' do
current_path.should == tree_project_ref_path(@project, "8470d70")
page.should have_content "app"
@@ -24,10 +24,6 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
page.should have_content "rubygems.org"
end
- Given 'I visit blob file from repo' do
- visit tree_project_ref_path(@project, ValidCommit::ID, :path => ValidCommit::BLOB_FILE_PATH)
- end
-
And 'I click link "raw"' do
click_link "raw"
end
@@ -35,17 +31,4 @@ class ProjectBrowseFiles < Spinach::FeatureSteps
Then 'I should see raw file content' do
page.source.should == ValidCommit::BLOB_FILE
end
-
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
- Given 'I visit project source page' do
- visit tree_project_ref_path(@project, @project.root_ref)
- end
end
diff --git a/features/steps/project_browse_git_repo.rb b/features/steps/project/project_browse_git_repo.rb
index 56b33a908a9..e966f407738 100644
--- a/features/steps/project_browse_git_repo.rb
+++ b/features/steps/project/project_browse_git_repo.rb
@@ -1,4 +1,8 @@
class ProjectBrowseGitRepo < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+
Given 'I click on "Gemfile" file in repo' do
click_link "Gemfile"
end
@@ -12,17 +16,4 @@ class ProjectBrowseGitRepo < Spinach::FeatureSteps
page.should have_content "Dmitriy Zaporozhets"
page.should have_content "bc3735004cb Moving to rails 3.2"
end
-
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
- Given 'I visit project source page' do
- visit tree_project_ref_path(@project, @project.root_ref)
- end
end
diff --git a/features/steps/project/project_browse_tags.rb b/features/steps/project/project_browse_tags.rb
new file mode 100644
index 00000000000..0cbfa0d80aa
--- /dev/null
+++ b/features/steps/project/project_browse_tags.rb
@@ -0,0 +1,10 @@
+class ProjectBrowseTags < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+
+ Then 'I should see "Shop" all tags list' do
+ page.should have_content "Tags"
+ page.should have_content "v1.2.1"
+ end
+end
diff --git a/features/steps/project/project_comment_commit.rb b/features/steps/project/project_comment_commit.rb
new file mode 100644
index 00000000000..cb8385e1ce5
--- /dev/null
+++ b/features/steps/project/project_comment_commit.rb
@@ -0,0 +1,6 @@
+class ProjectCommentCommit < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedNote
+ include SharedPaths
+end
diff --git a/features/steps/project_issues.rb b/features/steps/project/project_issues.rb
index c3fca0c68b3..64af24490aa 100644
--- a/features/steps/project_issues.rb
+++ b/features/steps/project/project_issues.rb
@@ -1,4 +1,9 @@
class ProjectIssues < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedNote
+ include SharedPaths
+
Given 'I should see "Release 0.4" in issues' do
page.should have_content "Release 0.4"
end
@@ -51,20 +56,6 @@ class ProjectIssues < Spinach::FeatureSteps
page.should have_content issue.project.name
end
- Given 'I visit issue page "Release 0.4"' do
- issue = Issue.find_by_title("Release 0.4")
- visit project_issue_path(issue.project, issue)
- end
-
- And 'I leave a comment like "XML attached"' do
- fill_in "note_note", :with => "XML attached"
- click_button "Add Comment"
- end
-
- Then 'I should see comment "XML attached"' do
- page.should have_content "XML attached"
- end
-
Given 'I fill in issue search with "Release"' do
fill_in 'issue_search', with: "Release"
end
@@ -90,22 +81,14 @@ class ProjectIssues < Spinach::FeatureSteps
project = Project.find_by_name("Shop")
milestone = Factory :milestone, :title => "v2.2", :project => project
- 3.times do
- issue = Factory :issue, :project => project, :milestone => milestone
- end
+ 3.times { Factory :issue, :project => project, :milestone => milestone }
end
And 'project "Shop" has milestone "v3.0"' do
project = Project.find_by_name("Shop")
milestone = Factory :milestone, :title => "v3.0", :project => project
- 3.times do
- issue = Factory :issue, :project => project, :milestone => milestone
- end
- end
-
- And 'I visit project "Shop" issues page' do
- visit project_issues_path(Project.find_by_name("Shop"))
+ 3.times { Factory :issue, :project => project, :milestone => milestone }
end
When 'I select milestone "v3.0"' do
@@ -132,15 +115,6 @@ class ProjectIssues < Spinach::FeatureSteps
page.find(issues_assignee_selector).should have_content(assignee_name)
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
And 'project "Shop" have "Release 0.4" open issue' do
project = Project.find_by_name("Shop")
Factory.create(:issue,
diff --git a/features/steps/project_labels.rb b/features/steps/project/project_labels.rb
index 2e83824fc20..1a347bf358f 100644
--- a/features/steps/project_labels.rb
+++ b/features/steps/project/project_labels.rb
@@ -1,4 +1,8 @@
class ProjectLabels < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+
Then 'I should see label "bug"' do
within ".labels-table" do
page.should have_content "bug"
@@ -11,23 +15,10 @@ class ProjectLabels < Spinach::FeatureSteps
end
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
And 'project "Shop" have issues tags: "bug", "feature"' do
project = Project.find_by_name("Shop")
['bug', 'feature'].each do |label|
Factory :issue, project: project, label_list: label
end
end
-
- Given 'I visit project "Shop" labels page' do
- visit project_labels_path(Project.find_by_name("Shop"))
- end
end
diff --git a/features/steps/project_merge_requests.rb b/features/steps/project/project_merge_requests.rb
index 8515e7e8a1c..80e83906c72 100644
--- a/features/steps/project_merge_requests.rb
+++ b/features/steps/project/project_merge_requests.rb
@@ -1,4 +1,9 @@
class ProjectMergeRequests < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedNote
+ include SharedPaths
+
Then 'I should see "Bug NS-04" in merge requests' do
page.should have_content "Bug NS-04"
end
@@ -56,29 +61,6 @@ class ProjectMergeRequests < Spinach::FeatureSteps
page.should have_content "Wiki Feature"
end
- Given 'I visit merge request page "Bug NS-04"' do
- mr = MergeRequest.find_by_title("Bug NS-04")
- visit project_merge_request_path(mr.project, mr)
- end
-
- And 'I leave a comment like "XML attached"' do
- fill_in "note_note", :with => "XML attached"
- click_button "Add Comment"
- end
-
- Then 'I should see comment "XML attached"' do
- page.should have_content "XML attached"
- end
-
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
And 'project "Shop" have "Bug NS-04" open merge request' do
project = Project.find_by_name("Shop")
Factory.create(:merge_request,
@@ -95,8 +77,4 @@ class ProjectMergeRequests < Spinach::FeatureSteps
:author => project.users.first,
:closed => true)
end
-
- And 'I visit project "Shop" merge requests page' do
- visit project_merge_requests_path(Project.find_by_name("Shop"))
- end
end
diff --git a/features/steps/project_milestones.rb b/features/steps/project/project_milestones.rb
index 97574d1c34d..83ed6859f1b 100644
--- a/features/steps/project_milestones.rb
+++ b/features/steps/project/project_milestones.rb
@@ -1,4 +1,8 @@
class ProjectMilestones < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+
Then 'I should see milestone "v2.2"' do
milestone = @project.milestones.find_by_title("v2.2")
page.should have_content(milestone.title[0..10])
@@ -26,26 +30,10 @@ class ProjectMilestones < Spinach::FeatureSteps
page.should have_content("Browse Issues")
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
And 'project "Shop" has milestone "v2.2"' do
project = Project.find_by_name("Shop")
milestone = Factory :milestone, :title => "v2.2", :project => project
- 3.times do
- issue = Factory :issue, :project => project, :milestone => milestone
- end
- end
-
- Given 'I visit project "Shop" milestones page' do
- @project = Project.find_by_name("Shop")
- visit project_milestones_path(@project)
+ 3.times { Factory :issue, :project => project, :milestone => milestone }
end
end
diff --git a/features/steps/project_network_graph.rb b/features/steps/project/project_network_graph.rb
index d87f3d82951..f34a81a408d 100644
--- a/features/steps/project_network_graph.rb
+++ b/features/steps/project/project_network_graph.rb
@@ -1,4 +1,7 @@
class ProjectNetworkGraph < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+
Then 'page should have network graph' do
page.should have_content "Project Network Graph"
within ".graph" do
@@ -7,15 +10,6 @@ class ProjectNetworkGraph < Spinach::FeatureSteps
end
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
And 'I visit project "Shop" network page' do
project = Project.find_by_name("Shop")
diff --git a/features/steps/project_team_management.rb b/features/steps/project/project_team_management.rb
index 9cee75bd9f8..7beca257e36 100644
--- a/features/steps/project_team_management.rb
+++ b/features/steps/project/project_team_management.rb
@@ -1,4 +1,8 @@
class ProjectTeamManagement < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedPaths
+
Then 'I should be able to see myself in team' do
page.should have_content(@user.name)
page.should have_content(@user.email)
@@ -42,10 +46,6 @@ class ProjectTeamManagement < Spinach::FeatureSteps
end
end
- Then 'I visit project "Shop" team page' do
- visit team_project_path(Project.find_by_name("Shop"))
- end
-
And 'I should see "Sam" in team list as "Reporter"' do
user = User.find_by_name("Sam")
role_id = find(".user_#{user.id} #team_member_project_access").value
@@ -73,15 +73,6 @@ class ProjectTeamManagement < Spinach::FeatureSteps
page.should_not have_content(user.email)
end
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
And 'gitlab user "Mike"' do
Factory :user, :name => "Mike"
end
diff --git a/features/steps/project/project_wall.rb b/features/steps/project/project_wall.rb
new file mode 100644
index 00000000000..ba9d3533b2c
--- /dev/null
+++ b/features/steps/project/project_wall.rb
@@ -0,0 +1,6 @@
+class ProjectWall < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedNote
+ include SharedPaths
+end
diff --git a/features/steps/project/project_wiki.rb b/features/steps/project/project_wiki.rb
new file mode 100644
index 00000000000..902e9ce158c
--- /dev/null
+++ b/features/steps/project/project_wiki.rb
@@ -0,0 +1,20 @@
+class ProjectWiki < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedProject
+ include SharedNote
+ include SharedPaths
+
+ Given 'I create Wiki page' do
+ fill_in "Title", :with => 'Test title'
+ fill_in "Content", :with => '[link test](test)'
+ click_on "Save"
+ end
+
+ Then 'I should see newly created wiki page' do
+ page.should have_content "Test title"
+ page.should have_content "link test"
+
+ click_link "link test"
+ page.should have_content "Editing page"
+ end
+end
diff --git a/features/steps/project_browse_tags.rb b/features/steps/project_browse_tags.rb
deleted file mode 100644
index c6bea691f04..00000000000
--- a/features/steps/project_browse_tags.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class ProjectBrowseTags < Spinach::FeatureSteps
- Then 'I should see "Shop" all tags list' do
- page.should have_content "Tags"
- page.should have_content "v1.2.1"
- end
-
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
- Given 'I visit project tags page' do
- visit tags_project_repository_path(@project)
- end
-end
diff --git a/features/steps/project_comment_commit.rb b/features/steps/project_comment_commit.rb
deleted file mode 100644
index 04e94c7def0..00000000000
--- a/features/steps/project_comment_commit.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-class ProjectCommentCommit < Spinach::FeatureSteps
- Given 'I leave a comment like "XML attached"' do
- fill_in "note_note", :with => "XML attached"
- click_button "Add Comment"
- end
-
- Then 'I should see comment "XML attached"' do
- page.should have_content "XML attached"
- end
-
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
- Given 'I visit project commit page' do
- visit project_commit_path(@project, ValidCommit::ID)
- end
-end
diff --git a/features/steps/project_wall.rb b/features/steps/project_wall.rb
deleted file mode 100644
index b94bd0bb1ef..00000000000
--- a/features/steps/project_wall.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-class ProjectWall < Spinach::FeatureSteps
- Given 'I write new comment "my special test message"' do
- fill_in "note_note", :with => "my special test message"
- click_button "Add Comment"
- end
-
- Then 'I should see project wall note "my special test message"' do
- page.should have_content "my special test message"
- end
-
- Then 'I visit project "Shop" wall page' do
- project = Project.find_by_name("Shop")
- visit wall_project_path(project)
- end
-
- Given 'I signin as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-end
diff --git a/features/steps/project_wiki.rb b/features/steps/project_wiki.rb
deleted file mode 100644
index 8c8c7c8d78d..00000000000
--- a/features/steps/project_wiki.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-class ProjectWiki < Spinach::FeatureSteps
- Given 'I create Wiki page' do
- fill_in "Title", :with => 'Test title'
- fill_in "Content", :with => '[link test](test)'
- click_on "Save"
- end
-
- Then 'I should see newly created wiki page' do
- page.should have_content "Test title"
- page.should have_content "link test"
-
- click_link "link test"
- page.should have_content "Editing page"
- end
-
- And 'I leave a comment like "XML attached"' do
- fill_in "note_note", :with => "XML attached"
- click_button "Add Comment"
- end
-
- Then 'I should see comment "XML attached"' do
- page.should have_content "XML attached"
- end
-
- Given 'I sign in as a user' do
- login_as :user
- end
-
- And 'I own project "Shop"' do
- @project = Factory :project, :name => "Shop"
- @project.add_access(@user, :admin)
- end
-
- Given 'I visit project wiki page' do
- visit project_wiki_path(@project, :index)
- end
-end
diff --git a/features/steps/shared/authentication.rb b/features/steps/shared/authentication.rb
new file mode 100644
index 00000000000..77d9839f5b7
--- /dev/null
+++ b/features/steps/shared/authentication.rb
@@ -0,0 +1,10 @@
+require Rails.root.join('spec', 'support', 'login_helpers')
+
+module SharedAuthentication
+ include Spinach::DSL
+ include LoginHelpers
+
+ Given 'I sign in as a user' do
+ login_as :user
+ end
+end
diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb
new file mode 100644
index 00000000000..923e69b6b07
--- /dev/null
+++ b/features/steps/shared/note.rb
@@ -0,0 +1,21 @@
+module SharedNote
+ include Spinach::DSL
+
+ Given 'I leave a comment like "XML attached"' do
+ fill_in "note_note", :with => "XML attached"
+ click_button "Add Comment"
+ end
+
+ Then 'I should see comment "XML attached"' do
+ page.should have_content "XML attached"
+ end
+
+ Given 'I write new comment "my special test message"' do
+ fill_in "note_note", :with => "my special test message"
+ click_button "Add Comment"
+ end
+
+ Then 'I should see project wall note "my special test message"' do
+ page.should have_content "my special test message"
+ end
+end
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
new file mode 100644
index 00000000000..05ae88e63e9
--- /dev/null
+++ b/features/steps/shared/paths.rb
@@ -0,0 +1,112 @@
+module SharedPaths
+ include Spinach::DSL
+
+ And 'I visit dashboard search page' do
+ visit search_path
+ end
+
+ And 'I visit dashboard merge requests page' do
+ visit dashboard_merge_requests_path
+ end
+
+ And 'I visit dashboard issues page' do
+ visit dashboard_issues_path
+ end
+
+ When 'I visit dashboard page' do
+ visit dashboard_path
+ end
+
+ Given 'I visit profile page' do
+ visit profile_path
+ end
+
+ Given 'I visit profile password page' do
+ visit profile_password_path
+ end
+
+ Given 'I visit profile token page' do
+ visit profile_token_path
+ end
+
+ When 'I visit new project page' do
+ visit new_project_path
+ end
+
+ And 'I visit project "Shop" page' do
+ project = Project.find_by_name("Shop")
+ visit project_path(project)
+ end
+
+ Given 'I visit project branches page' do
+ visit branches_project_repository_path(@project)
+ end
+
+ Given 'I visit compare refs page' do
+ visit compare_project_commits_path(@project)
+ end
+
+ Given 'I visit project commits page' do
+ visit project_commits_path(@project)
+ end
+
+ Given 'I visit project source page' do
+ visit tree_project_ref_path(@project, @project.root_ref)
+ end
+
+ Given 'I visit blob file from repo' do
+ visit tree_project_ref_path(@project, ValidCommit::ID, :path => ValidCommit::BLOB_FILE_PATH)
+ end
+
+ Given 'I visit project source page for "8470d70"' do
+ visit tree_project_ref_path(@project, "8470d70")
+ end
+
+ Given 'I visit project tags page' do
+ visit tags_project_repository_path(@project)
+ end
+
+ Given 'I visit project commit page' do
+ visit project_commit_path(@project, ValidCommit::ID)
+ end
+
+ And 'I visit project "Shop" issues page' do
+ visit project_issues_path(Project.find_by_name("Shop"))
+ end
+
+ Given 'I visit issue page "Release 0.4"' do
+ issue = Issue.find_by_title("Release 0.4")
+ visit project_issue_path(issue.project, issue)
+ end
+
+ Given 'I visit project "Shop" labels page' do
+ visit project_labels_path(Project.find_by_name("Shop"))
+ end
+
+ Given 'I visit merge request page "Bug NS-04"' do
+ mr = MergeRequest.find_by_title("Bug NS-04")
+ visit project_merge_request_path(mr.project, mr)
+ end
+
+ And 'I visit project "Shop" merge requests page' do
+ visit project_merge_requests_path(Project.find_by_name("Shop"))
+ end
+
+ Given 'I visit project "Shop" milestones page' do
+ @project = Project.find_by_name("Shop")
+ visit project_milestones_path(@project)
+ end
+
+ Then 'I visit project "Shop" team page' do
+ visit team_project_path(Project.find_by_name("Shop"))
+ end
+
+ Then 'I visit project "Shop" wall page' do
+ project = Project.find_by_name("Shop")
+ visit wall_project_path(project)
+ end
+
+ Given 'I visit project wiki page' do
+ visit project_wiki_path(@project, :index)
+ end
+end
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
new file mode 100644
index 00000000000..9b64ca59a3b
--- /dev/null
+++ b/features/steps/shared/project.rb
@@ -0,0 +1,8 @@
+module SharedProject
+ include Spinach::DSL
+
+ And 'I own project "Shop"' do
+ @project = Factory :project, :name => "Shop"
+ @project.add_access(@user, :admin)
+ end
+end
diff --git a/features/support/env.rb b/features/support/env.rb
index 7bd89801da1..9c6cef07298 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -5,11 +5,12 @@ require 'rspec'
require 'database_cleaner'
require 'spinach/capybara'
-%w(gitolite_stub login_helpers stubbed_repository valid_commit).each do |f|
+%w(gitolite_stub stubbed_repository valid_commit).each do |f|
require Rails.root.join('spec', 'support', f)
end
-include LoginHelpers
+Dir["#{Rails.root}/features/steps/shared/*.rb"].each {|file| require file}
+
include GitoliteStub
WebMock.allow_net_connect!