Commit 24229185 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add some tests to compare api

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent f441436e
......@@ -112,4 +112,24 @@ describe API::API, api: true do
response.status.should == 404
end
end
describe 'GET /GET /projects/:id/repository/compare' do
it "should compare 2 branches" do
get api("/projects/#{project.id}/repository/compare", user), from: 'master', to: 'simple_merge_request'
response.status.should == 200
json_response['commits'].size.should == 3
end
it "should compare 2 commits" do
get api("/projects/#{project.id}/repository/compare", user), from: 'b1e6a9dbf1c85', to: '1e689bfba395'
response.status.should == 200
json_response['commits'].size.should == 0
end
it "should compare 2 commits" do
get api("/projects/#{project.id}/repository/compare", user), from: '1e689bfba395', to: 'b1e6a9dbf1c85'
response.status.should == 200
json_response['commits'].size.should == 4
end
end
end
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