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
iv
gitlab-ce
Commits
09d5868c
Commit
09d5868c
authored
Jan 14, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix mr controller specs
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
0de6e2da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
app/models/merge_request.rb
app/models/merge_request.rb
+5
-4
spec/controllers/merge_requests_controller_spec.rb
spec/controllers/merge_requests_controller_spec.rb
+2
-2
No files found.
app/models/merge_request.rb
View file @
09d5868c
...
...
@@ -214,8 +214,8 @@ class MergeRequest < ActiveRecord::Base
self
.
merge
end
def
automerge!
(
current_user
,
merge_
commit_message
=
nil
)
if
Gitlab
::
Satellite
::
MergeAction
.
new
(
current_user
,
self
).
merge!
(
merge_
commit_message
)
&&
self
.
unmerged_commits
.
empty?
def
automerge!
(
current_user
,
commit_message
=
nil
)
if
Gitlab
::
Satellite
::
MergeAction
.
new
(
current_user
,
self
).
merge!
(
commit_message
)
&&
self
.
unmerged_commits
.
empty?
self
.
merge!
(
current_user
.
id
)
true
end
...
...
@@ -322,9 +322,10 @@ class MergeRequest < ActiveRecord::Base
def
merge_commit_message
message
=
"Merge branch '
#{
source_branch
}
' into '
#{
target_branch
}
'"
message
<<
"
\n\n
"
message
<<
title
message
<<
title
.
to_s
message
<<
"
\n\n
"
message
<<
description
message
<<
description
.
to_s
message
end
private
...
...
spec/controllers/merge_requests_controller_spec.rb
View file @
09d5868c
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
Projects
::
MergeRequestsController
do
let
(
:project
)
{
create
(
:project_with_code
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
,
target_branch:
"
bcf03b5d~3"
,
source_branch:
"bcf03b5d
"
)
}
let
(
:merge_request
)
{
create
(
:merge_request_with_diffs
,
target_project:
project
,
source_project:
project
,
target_branch:
"
stable"
,
source_branch:
"master
"
)
}
before
do
sign_in
(
user
)
...
...
@@ -61,7 +61,7 @@ describe Projects::MergeRequestsController do
it
"should really be a git email patch with commit"
do
get
:show
,
project_id:
project
.
to_param
,
id:
merge_request
.
iid
,
format:
format
expect
(
response
.
body
[
0
..
100
]).
to
start_with
(
"From
#{
merge_request
.
commits
.
last
.
id
}
"
)
expect
(
response
.
body
[
0
..
100
]).
to
start_with
(
"From
6ea87c47f0f8a24ae031c3fff17bc913889ecd00
"
)
end
it
"should contain git diffs"
do
...
...
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