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
7cbf8fd0
Commit
7cbf8fd0
authored
Mar 09, 2016
by
Pierre de La Morinerie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for MergeRequest#source_sha
parent
a34021cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+18
-0
No files found.
spec/models/merge_request_spec.rb
View file @
7cbf8fd0
...
...
@@ -86,6 +86,24 @@ describe MergeRequest, models: true do
end
end
describe
'#source_sha'
do
let
(
:last_branch_commit
)
{
subject
.
source_project
.
repository
.
commit
(
subject
.
source_branch
)
}
context
'with diffs'
do
subject
{
create
(
:merge_request
,
:with_diffs
)
}
it
'returns the sha of the source branch last commit'
do
expect
(
subject
.
source_sha
).
to
eq
(
last_branch_commit
.
sha
)
end
end
context
'when the merge request is being created'
do
subject
{
build
(
:merge_request
,
source_branch:
nil
,
compare_commits:
[])
}
it
'returns nil'
do
expect
(
subject
.
source_sha
).
to
be_nil
end
end
end
describe
'#to_reference'
do
it
'returns a String reference to the object'
do
expect
(
subject
.
to_reference
).
to
eq
"!
#{
subject
.
iid
}
"
...
...
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