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
90c78b17
Commit
90c78b17
authored
Apr 27, 2021
by
Abhishek Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated some specs
parent
bb452c85
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
17 deletions
+12
-17
spec/models/context_commits_diff_spec.rb
spec/models/context_commits_diff_spec.rb
+8
-13
spec/serializers/context_commits_diff_entity_spec.rb
spec/serializers/context_commits_diff_entity_spec.rb
+4
-4
No files found.
spec/models/context_commits_diff_spec.rb
View file @
90c78b17
...
...
@@ -3,19 +3,14 @@
require
'spec_helper'
RSpec
.
describe
ContextCommitsDiff
do
let
(
:sha1
)
{
"33f3729a45c02fc67d00adb1b8bca394b0e761d9"
}
let
(
:sha2
)
{
"ae73cb07c9eeaf35924a10f713b364d32b2dd34f"
}
let
(
:sha3
)
{
"0b4bc9a49b562e85de7cc9e834518ea6828729b9"
}
let
(
:merge_request
)
do
create
(
:merge_request
)
do
|
merge_request
|
project
=
merge_request
.
project
mrcc1
=
create
(
:merge_request_context_commit
,
sha:
sha1
,
committed_date:
project
.
commit_by
(
oid:
sha1
).
committed_date
)
mrcc2
=
create
(
:merge_request_context_commit
,
sha:
sha2
,
committed_date:
project
.
commit_by
(
oid:
sha2
).
committed_date
)
mrcc3
=
create
(
:merge_request_context_commit
,
sha:
sha3
,
committed_date:
project
.
commit_by
(
oid:
sha3
).
committed_date
)
merge_request
.
merge_request_context_commits
<<
[
mrcc1
,
mrcc2
,
mrcc3
]
end
end
let_it_be
(
:sha1
)
{
"33f3729a45c02fc67d00adb1b8bca394b0e761d9"
}
let_it_be
(
:sha2
)
{
"ae73cb07c9eeaf35924a10f713b364d32b2dd34f"
}
let_it_be
(
:sha3
)
{
"0b4bc9a49b562e85de7cc9e834518ea6828729b9"
}
let_it_be
(
:merge_request
)
{
create
(
:merge_request
)
}
let_it_be
(
:project
)
{
merge_request
.
project
}
let_it_be
(
:mrcc1
)
{
create
(
:merge_request_context_commit
,
merge_request:
merge_request
,
sha:
sha1
,
committed_date:
project
.
commit_by
(
oid:
sha1
).
committed_date
)
}
let_it_be
(
:mrcc2
)
{
create
(
:merge_request_context_commit
,
merge_request:
merge_request
,
sha:
sha2
,
committed_date:
project
.
commit_by
(
oid:
sha2
).
committed_date
)
}
let_it_be
(
:mrcc3
)
{
create
(
:merge_request_context_commit
,
merge_request:
merge_request
,
sha:
sha3
,
committed_date:
project
.
commit_by
(
oid:
sha3
).
committed_date
)
}
subject
{
merge_request
.
context_commits_diff
}
...
...
spec/serializers/context_commits_diff_entity_spec.rb
View file @
90c78b17
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
RSpec
.
describe
ContextCommitsDiffEntity
do
let
(
:mrcc1
)
{
create
(
:merge_request_context_commit
,
sha:
"cfe32cf61b73a0d5e9f13e774abde7ff789b1660"
)
}
let
(
:mrcc2
)
{
create
(
:merge_request_context_commit
,
sha:
"ae73cb07c9eeaf35924a10f713b364d32b2dd34f
"
)
}
let
(
:merge_request
)
{
create
(
:merge_request
)
{
|
merge_request
|
merge_request
.
merge_request_context_commits
<<
[
mrcc1
,
mrcc2
]
}
}
let
_it_be
(
:merge_request
)
{
create
(
:merge_request
)
}
let
_it_be
(
:mrcc1
)
{
create
(
:merge_request_context_commit
,
merge_request:
merge_request
,
sha:
"cfe32cf61b73a0d5e9f13e774abde7ff789b1660
"
)
}
let
_it_be
(
:mrcc2
)
{
create
(
:merge_request_context_commit
,
merge_request:
merge_request
,
sha:
"ae73cb07c9eeaf35924a10f713b364d32b2dd34f"
)
}
context
'as json'
do
subject
{
ContextCommitsDiffEntity
.
represent
(
merge_request
.
context_commits_diff
).
as_json
}
...
...
@@ -19,7 +19,7 @@ RSpec.describe ContextCommitsDiffEntity do
end
it
'exposes diffs_path'
do
expect
(
subject
[
:diffs_path
]).
to
match
(
/\/-\/merge_requests\/\d\/diffs\?only_context_commits=true$/
)
expect
(
subject
[
:diffs_path
]).
to
eq
(
Gitlab
::
Routing
.
url_helpers
.
diffs_project_merge_request_path
(
merge_request
.
project
,
merge_request
,
only_context_commits:
true
)
)
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