Commit 2e5747cf authored by Mathias Neerup's avatar Mathias Neerup

Test comparing between two projects

parent 16e96d36
......@@ -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' }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment