Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
70fb26a6
Commit
70fb26a6
authored
Feb 03, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract projects and mr into methods in features.
parent
75cecf36
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
51 deletions
+45
-51
features/public/public_projects.feature
features/public/public_projects.feature
+3
-0
features/steps/public/projects_feature.rb
features/steps/public/projects_feature.rb
+42
-51
No files found.
features/public/public_projects.feature
View file @
70fb26a6
...
@@ -84,15 +84,18 @@ Feature: Public Projects Feature
...
@@ -84,15 +84,18 @@ Feature: Public Projects Feature
Given
I sign in as a user
Given
I sign in as a user
Given
I visit project
"Community"
page
Given
I visit project
"Community"
page
And
I visit
"Community"
merge requests page
And
I visit
"Community"
merge requests page
And
project
"Community"
has
"Bug fix"
open merge request
Then
I should see list of merge requests for
"Community"
project
Then
I should see list of merge requests for
"Community"
project
Scenario
:
I
visit public project merge requests page as a non authorized user
Scenario
:
I
visit public project merge requests page as a non authorized user
Given
I visit project
"Community"
page
Given
I visit project
"Community"
page
And
I visit
"Community"
merge requests page
And
I visit
"Community"
merge requests page
And
project
"Community"
has
"Bug fix"
open merge request
Then
I should see list of merge requests for
"Community"
project
Then
I should see list of merge requests for
"Community"
project
Scenario
:
I
visit internal project merge requests page as an authorized user
Scenario
:
I
visit internal project merge requests page as an authorized user
Given
I sign in as a user
Given
I sign in as a user
Given
I visit project
"Internal"
page
Given
I visit project
"Internal"
page
And
I visit
"Internal"
merge requests page
And
I visit
"Internal"
merge requests page
And
project
"Internal"
has
"Feature implemented"
open merge request
Then
I should see list of merge requests for
"Internal"
project
Then
I should see list of merge requests for
"Internal"
project
features/steps/public/projects_feature.rb
View file @
70fb26a6
...
@@ -109,101 +109,92 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
...
@@ -109,101 +109,92 @@ class Spinach::Features::PublicProjectsFeature < Spinach::FeatureSteps
end
end
step
'I visit "Community" issues page'
do
step
'I visit "Community" issues page'
do
project
=
Project
.
find_by
(
name:
'Community'
)
create
(
:issue
,
create
(
:issue
,
title:
"Bug"
,
title:
"Bug"
,
project:
project
project:
p
ublic_p
roject
)
)
create
(
:issue
,
create
(
:issue
,
title:
"New feature"
,
title:
"New feature"
,
project:
project
project:
p
ublic_p
roject
)
)
visit
project_issues_path
(
project
)
visit
project_issues_path
(
p
ublic_p
roject
)
end
end
step
'I should see list of issues for "Community" project'
do
step
'I should see list of issues for "Community" project'
do
project
=
Project
.
find_by
(
name:
'Community'
)
page
.
should
have_content
"Bug"
page
.
should
have_content
"Bug"
page
.
should
have_content
project
.
name
page
.
should
have_content
p
ublic_p
roject
.
name
page
.
should
have_content
"New feature"
page
.
should
have_content
"New feature"
end
end
step
'I visit "Internal" issues page'
do
step
'I visit "Internal" issues page'
do
project
=
Project
.
find_by
(
name:
'Internal'
)
create
(
:issue
,
create
(
:issue
,
title:
"Internal Bug"
,
title:
"Internal Bug"
,
project:
project
project:
internal_
project
)
)
create
(
:issue
,
create
(
:issue
,
title:
"New internal feature"
,
title:
"New internal feature"
,
project:
project
project:
internal_
project
)
)
visit
project_issues_path
(
project
)
visit
project_issues_path
(
internal_
project
)
end
end
step
'I should see list of issues for "Internal" project'
do
step
'I should see list of issues for "Internal" project'
do
project
=
Project
.
find_by
(
name:
'Internal'
)
page
.
should
have_content
"Internal Bug"
page
.
should
have_content
"Internal Bug"
page
.
should
have_content
project
.
name
page
.
should
have_content
internal_
project
.
name
page
.
should
have_content
"New internal feature"
page
.
should
have_content
"New internal feature"
end
end
step
'I visit "Community" merge requests page'
do
step
'I visit "Community" merge requests page'
do
project
=
Project
.
find_by
(
name:
'Community'
)
visit
project_merge_requests_path
(
public_project
)
create
(
:merge_request
,
end
title:
"Bug fix"
,
source_project:
project
,
step
'project "Community" has "Bug fix" open merge request'
do
target_project:
project
,
source_branch:
'stable'
,
target_branch:
'master'
,
)
create
(
:merge_request
,
create
(
:merge_request
,
title:
"Feature created"
,
title:
"Bug fix for public project"
,
source_project:
project
,
source_project:
public_project
,
target_project:
project
,
target_project:
public_project
,
source_branch:
'stable'
,
target_branch:
'master'
,
)
)
visit
project_merge_requests_path
(
project
)
end
end
step
'I should see list of merge requests for "Community" project'
do
step
'I should see list of merge requests for "Community" project'
do
project
=
Project
.
find_by
(
name:
'Community'
)
page
.
should
have_content
public_project
.
name
page
.
should
have_content
public_merge_request
.
source_project
.
name
page
.
should
have_content
"Bug fix"
page
.
should
have_content
project
.
name
page
.
should
have_content
"Feature created"
end
end
step
'I visit "Internal" merge requests page'
do
step
'I visit "Internal" merge requests page'
do
project
=
Project
.
find_by
(
name:
'Internal'
)
visit
project_merge_requests_path
(
internal_project
)
create
(
:merge_request
,
end
title:
"Bug fix internal"
,
source_project:
project
,
step
'project "Internal" has "Feature implemented" open merge request'
do
target_project:
project
,
source_branch:
'stable'
,
target_branch:
'master'
,
)
create
(
:merge_request
,
create
(
:merge_request
,
title:
"Feature created for internal"
,
title:
"Feature implemented"
,
source_project:
project
,
source_project:
internal_project
,
target_project:
project
,
target_project:
internal_project
source_branch:
'stable'
,
target_branch:
'master'
,
)
)
visit
project_merge_requests_path
(
project
)
end
end
step
'I should see list of merge requests for "Internal" project'
do
step
'I should see list of merge requests for "Internal" project'
do
project
=
Project
.
find_by
(
name:
'Internal'
)
page
.
should
have_content
internal_project
.
name
page
.
should
have_content
internal_merge_request
.
source_project
.
name
end
def
internal_project
@internal_project
||=
Project
.
find_by!
(
name:
'Internal'
)
end
def
public_project
@public_project
||=
Project
.
find_by!
(
name:
'Community'
)
end
def
internal_merge_request
@internal_merge_request
||=
MergeRequest
.
find_by!
(
title:
'Feature implemented'
)
end
page
.
should
have_content
"Bug fix internal"
def
public_merge_request
page
.
should
have_content
project
.
name
@public_merge_request
||=
MergeRequest
.
find_by!
(
title:
'Bug fix for public project'
)
page
.
should
have_content
"Feature created for internal"
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment