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
Boxiang Sun
gitlab-ce
Commits
e6b5f4ad
Commit
e6b5f4ad
authored
Feb 28, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor finders in spianch:merge_request.feature
parent
51b547f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
features/project/merge_requests.feature
features/project/merge_requests.feature
+5
-5
features/steps/project/project_merge_requests.rb
features/steps/project/project_merge_requests.rb
+17
-17
No files found.
features/project/merge_requests.feature
View file @
e6b5f4ad
...
...
@@ -34,11 +34,11 @@ Feature: Project Merge Requests
And
I submit new merge request
"Wiki Feature"
Then
I should see merge request
"Wiki Feature"
#
@javascript
#
Scenario: I comment on a merge request
#
Given I visit merge request page "Bug NS-04"
#
And I leave a comment like "XML attached"
#
Then I should see comment "XML attached"
@javascript
Scenario
:
I
comment on a merge request
Given
I visit merge request page
"Bug NS-04"
And
I leave a comment like
"XML attached"
Then
I should see comment
"XML attached"
@javascript
Scenario
:
I
comment on a merge request diff
...
...
features/steps/project/project_merge_requests.rb
View file @
e6b5f4ad
...
...
@@ -25,8 +25,8 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
Then
'I should see closed merge request "Bug NS-04"'
do
m
r
=
MergeRequest
.
find_by_title
(
"Bug NS-04"
)
m
r
.
closed?
.
should
be_true
m
erge_request
=
MergeRequest
.
find_by_title!
(
"Bug NS-04"
)
m
erge_request
.
closed?
.
should
be_true
page
.
should
have_content
"Closed by"
end
...
...
@@ -63,7 +63,6 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
And
'project "Shop" have "Bug NS-04" open merge request'
do
project
=
Project
.
find_by_name
(
"Shop"
)
create
(
:merge_request
,
title:
"Bug NS-04"
,
project:
project
,
...
...
@@ -71,7 +70,6 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
And
'project "Shop" have "Bug NS-05" open merge request with diffs inside'
do
project
=
Project
.
find_by_name
(
"Shop"
)
create
(
:merge_request_with_diffs
,
title:
"Bug NS-05"
,
project:
project
,
...
...
@@ -79,7 +77,6 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
And
'project "Shop" have "Feature NS-03" closed merge request'
do
project
=
Project
.
find_by_name
(
"Shop"
)
create
(
:closed_merge_request
,
title:
"Feature NS-03"
,
project:
project
,
...
...
@@ -87,18 +84,16 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
And
'I switch to the diff tab'
do
mr
=
MergeRequest
.
find_by_title
(
"Bug NS-05"
)
visit
diffs_project_merge_request_path
(
mr
.
project
,
mr
)
visit
diffs_project_merge_request_path
(
merge_request
.
project
,
merge_request
)
end
And
'I switch to the merge request\'s comments tab'
do
mr
=
MergeRequest
.
find_by_title
(
"Bug NS-05"
)
visit
project_merge_request_path
(
mr
.
project
,
mr
)
visit
project_merge_request_path
(
merge_request
.
project
,
merge_request
)
end
And
'I click on the first commit in the merge request'
do
mr
=
MergeRequest
.
find_by_title
(
"Bug NS-05"
)
click_link
m
r
.
commits
.
first
.
short_id
(
8
)
click_link
m
erge_request
.
commits
.
first
.
short_id
(
8
)
end
And
'I leave a comment on the diff page'
do
...
...
@@ -121,8 +116,7 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
Then
'I should see a discussion has started on line 185'
do
mr
=
MergeRequest
.
find_by_title
(
"Bug NS-05"
)
first_commit
=
mr
.
commits
.
first
first_commit
=
merge_request
.
commits
.
first
first_diff
=
first_commit
.
diffs
.
first
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion on this merge request diff"
page
.
should
have_content
"
#{
first_diff
.
b_path
}
:L185"
...
...
@@ -130,8 +124,7 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
Then
'I should see a discussion has started on commit bcf03b5de6c:L185'
do
mr
=
MergeRequest
.
find_by_title
(
"Bug NS-05"
)
first_commit
=
mr
.
commits
.
first
first_commit
=
merge_request
.
commits
.
first
first_diff
=
first_commit
.
diffs
.
first
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion on commit"
page
.
should
have_content
first_commit
.
short_id
(
8
)
...
...
@@ -140,12 +133,19 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
Then
'I should see a discussion has started on commit bcf03b5de6c'
do
mr
=
MergeRequest
.
find_by_title
(
"Bug NS-05"
)
first_commit
=
mr
.
st_commits
.
first
first_commit
=
merge_request
.
st_commits
.
first
first_diff
=
first_commit
.
diffs
.
first
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion on commit bcf03b5de6c"
page
.
should
have_content
first_commit
.
short_id
(
8
)
page
.
should
have_content
"One comment to rule them all"
page
.
should
have_content
"
#{
first_diff
.
b_path
}
:L185"
end
def
project
@project
||=
Project
.
find_by_name!
(
"Shop"
)
end
def
merge_request
@merge_request
||=
MergeRequest
.
find_by_title!
(
"Bug NS-05"
)
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