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
2e5747cf
Commit
2e5747cf
authored
Mar 31, 2021
by
Mathias Neerup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test comparing between two projects
parent
16e96d36
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
spec/requests/api/repositories_spec.rb
spec/requests/api/repositories_spec.rb
+9
-0
No files found.
spec/requests/api/repositories_spec.rb
View file @
2e5747cf
...
...
@@ -332,6 +332,7 @@ RSpec.describe API::Repositories do
describe
'GET /projects/:id/repository/compare'
do
let
(
:route
)
{
"/projects/
#{
project
.
id
}
/repository/compare"
}
let!
(
:public_project
)
{
create
(
:project
,
:repository
,
:public
)
}
shared_examples_for
'repository compare'
do
it
"compares branches"
do
...
...
@@ -392,6 +393,14 @@ RSpec.describe API::Repositories do
expect
(
json_response
[
'diffs'
]).
to
be_present
end
it
"Compare commits between different projects"
do
get
api
(
route
,
current_user
),
params:
{
from:
sample_commit
.
parent_id
,
to:
sample_commit
.
id
,
from_project_id:
public_project
.
id
}
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
'commits'
]).
to
be_present
expect
(
json_response
[
'diffs'
]).
to
be_present
end
it
"compares same refs"
do
get
api
(
route
,
current_user
),
params:
{
from:
'master'
,
to:
'master'
}
...
...
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