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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
e2b39517
Commit
e2b39517
authored
Mar 16, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some test covering merge request update hook
parent
7f76d6cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+28
-0
No files found.
spec/models/project_spec.rb
View file @
e2b39517
...
...
@@ -160,6 +160,34 @@ describe Project do
end
end
end
describe
:update_merge_requests
do
let
(
:project
)
{
Factory
:project
}
before
do
@merge_request
=
Factory
:merge_request
,
:project
=>
project
,
:merged
=>
false
,
:closed
=>
false
@key
=
Factory
:key
,
:user_id
=>
project
.
owner
.
id
end
it
"should close merge request if last commit from source branch was pushed to target branch"
do
@merge_request
.
reloaded_commits
@merge_request
.
last_commit
.
id
.
should
==
"bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a"
project
.
update_merge_requests
(
"8716fc78f3c65bbf7bcf7b574febd583bc5d2812"
,
"bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a"
,
"refs/heads/stable"
,
@key
.
identifier
)
@merge_request
.
reload
@merge_request
.
merged
.
should
be_true
@merge_request
.
closed
.
should
be_true
end
it
"should update merge request commits with new one if pushed to source branch"
do
@merge_request
.
last_commit
.
should
==
nil
project
.
update_merge_requests
(
"8716fc78f3c65bbf7bcf7b574febd583bc5d2812"
,
"bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a"
,
"refs/heads/master"
,
@key
.
identifier
)
@merge_request
.
reload
@merge_request
.
last_commit
.
id
.
should
==
"bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a"
end
end
end
# == Schema Information
#
...
...
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