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
e1b78c36
Commit
e1b78c36
authored
Jul 11, 2019
by
George Koltsov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MergeRequest#diff_refs spec
parent
19dcb081
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+17
-6
No files found.
spec/models/merge_request_spec.rb
View file @
e1b78c36
...
...
@@ -2454,6 +2454,13 @@ describe MergeRequest do
describe
"#diff_refs"
do
context
"with diffs"
do
subject
{
create
(
:merge_request
,
:with_diffs
)
}
let
(
:expected_diff_refs
)
{
Gitlab
::
Diff
::
DiffRefs
.
new
(
base_sha:
subject
.
merge_request_diff
.
base_commit_sha
,
start_sha:
subject
.
merge_request_diff
.
start_commit_sha
,
head_sha:
subject
.
merge_request_diff
.
head_commit_sha
)
}
it
"does not touch the repository"
do
subject
# Instantiate the object
...
...
@@ -2464,14 +2471,18 @@ describe MergeRequest do
end
it
"returns expected diff_refs"
do
expected_diff_refs
=
Gitlab
::
Diff
::
DiffRefs
.
new
(
base_sha:
subject
.
merge_request_diff
.
base_commit_sha
,
start_sha:
subject
.
merge_request_diff
.
start_commit_sha
,
head_sha:
subject
.
merge_request_diff
.
head_commit_sha
)
expect
(
subject
.
diff_refs
).
to
eq
(
expected_diff_refs
)
end
context
'when importing'
do
before
do
subject
.
importing
=
true
end
it
"returns MR diff_refs"
do
expect
(
subject
.
diff_refs
).
to
eq
(
expected_diff_refs
)
end
end
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