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
ee4643c7
Commit
ee4643c7
authored
Jul 31, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MR tests
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
5a68c20f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
20 deletions
+43
-20
features/project/merge_requests.feature
features/project/merge_requests.feature
+7
-7
features/steps/project/merge_requests.rb
features/steps/project/merge_requests.rb
+16
-13
spec/support/repo_helpers.rb
spec/support/repo_helpers.rb
+20
-0
No files found.
features/project/merge_requests.feature
View file @
ee4643c7
...
...
@@ -52,27 +52,27 @@ Feature: Project Merge Requests
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
I visit merge request page
"Bug NS-05"
And
I switch to the diff tab
And
I leave a comment like
"Line is wrong"
on
line 185 of the first file
And
I leave a comment like
"Line is wrong"
on
diff
And
I switch to the merge request's comments tab
Then
I should see a discussion has started on
line 185
Then
I should see a discussion has started on
diff
@javascript
Scenario
:
I
comment on a line of a commit in merge request
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
I visit merge request page
"Bug NS-05"
And
I click on the
first
commit in the merge request
And
I leave a comment like
"Line is wrong"
on
line 185 of the first file
in commit
And
I click on the commit in the merge request
And
I leave a comment like
"Line is wrong"
on
diff
in commit
And
I switch to the merge request's comments tab
Then I should see a discussion has started on commit
b1e6a9dbf1
:
L185
Then
I should see a discussion has started on commit
diff
@javascript
Scenario
:
I
comment on a commit in merge request
Given
project
"Shop"
have
"Bug NS-05"
open merge request with diffs inside
And
I visit merge request page
"Bug NS-05"
And
I click on the
first
commit in the merge request
And
I click on the commit in the merge request
And
I leave a comment on the diff page in commit
And
I switch to the merge request's comments tab
Then
I should see a discussion has started on commit
b1e6a9dbf1
Then
I should see a discussion has started on commit
@javascript
Scenario
:
I
accept merge request with custom commit message
...
...
features/steps/project/merge_requests.rb
View file @
ee4643c7
...
...
@@ -104,9 +104,9 @@ class ProjectMergeRequests < Spinach::FeatureSteps
visit
project_merge_request_path
(
project
,
merge_request
)
end
step
'I click on the
first
commit in the merge request'
do
within
'.
first
-commits'
do
click_link
merge_request
.
commits
.
first
.
short_id
(
8
)
step
'I click on the commit in the merge request'
do
within
'.
mr
-commits'
do
click_link
sample_commit
.
id
[
0
..
8
]
end
end
...
...
@@ -120,32 +120,31 @@ class ProjectMergeRequests < Spinach::FeatureSteps
leave_comment
"One comment to rule them all"
end
step
'I leave a comment like "Line is wrong" on
line 185 of the first file
'
do
step
'I leave a comment like "Line is wrong" on
diff
'
do
init_diff_note
leave_comment
"Line is wrong"
end
step
'I leave a comment like "Line is wrong" on
line 185 of the first file
in commit'
do
step
'I leave a comment like "Line is wrong" on
diff
in commit'
do
click_diff_line
(
sample_commit
.
line_code
)
leave_comment
"Line is wrong"
end
step
'I should see a discussion has started on
line 185
'
do
step
'I should see a discussion has started on
diff
'
do
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion"
page
.
should
have_content
"app/assets/stylesheets/tree.scss"
page
.
should
have_content
sample_commit
.
line_code_path
page
.
should
have_content
"Line is wrong"
end
step
'I should see a discussion has started on commit
b1e6a9dbf1:L185
'
do
step
'I should see a discussion has started on commit
diff
'
do
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion on commit"
page
.
should
have_content
"app/assets/stylesheets/tree.scss"
page
.
should
have_content
sample_commit
.
line_code_path
page
.
should
have_content
"Line is wrong"
end
step
'I should see a discussion has started on commit
b1e6a9dbf1
'
do
step
'I should see a discussion has started on commit'
do
page
.
should
have_content
"
#{
current_user
.
name
}
started a discussion on commit"
page
.
should
have_content
"One comment to rule them all"
page
.
should
have_content
"app/assets/stylesheets/tree.scss"
end
step
'merge request is mergeable'
do
...
...
@@ -162,6 +161,10 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
step
'I accept this merge request'
do
Gitlab
::
Satellite
::
MergeAction
.
any_instance
.
stub
(
merge!:
true
,
)
click_button
"Accept Merge Request"
end
...
...
@@ -261,11 +264,11 @@ class ProjectMergeRequests < Spinach::FeatureSteps
end
def
init_diff_note_first_file
click_diff_line
(
sample_com
mit
.
line_code
)
click_diff_line
(
sample_com
pare
.
changes
[
0
][
:line_code
]
)
end
def
init_diff_note_second_file
click_diff_line
(
sample_com
mit
.
del_line_code
)
click_diff_line
(
sample_com
pare
.
changes
[
1
][
:line_code
]
)
end
def
have_visible_content
(
text
)
...
...
spec/support/repo_helpers.rb
View file @
ee4643c7
...
...
@@ -33,6 +33,7 @@ eos
author_email:
"dmitriy.zaporozhets@gmail.com"
,
files_changed_count:
2
,
line_code:
'2f6fcd96b88b36ce98c38da085c795a27d92a3dd_15_14'
,
line_code_path:
'files/ruby/popen.rb'
,
del_line_code:
'2f6fcd96b88b36ce98c38da085c795a27d92a3dd_13_13'
,
message:
<<
eos
Change some files
...
...
@@ -66,4 +67,23 @@ Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
eos
)
end
def
sample_compare
changes
=
[
{
line_code:
'a5cc2925ca8258af241be7e5b0381edf30266302_20_20'
,
file_path:
'.gitignore'
,
},
{
line_code:
'7445606fbf8f3683cd42bdc54b05d7a0bc2dfc44_4_6'
,
file_path:
'.gitmodules'
,
}
]
OpenStruct
.
new
(
source_branch:
'master'
,
target_branch:
'feature'
,
changes:
changes
)
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