Commit 242291850d7513731355c42e67c2f8c3cc727451
1 parent
f441436e
Exists in
spb-stable
and in
2 other branches
Add some tests to compare api
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
1 changed file
with
20 additions
and
0 deletions
Show diff stats
spec/requests/api/repositories_spec.rb
| ... | ... | @@ -112,4 +112,24 @@ describe API::API, api: true do |
| 112 | 112 | response.status.should == 404 |
| 113 | 113 | end |
| 114 | 114 | end |
| 115 | + | |
| 116 | + describe 'GET /GET /projects/:id/repository/compare' do | |
| 117 | + it "should compare 2 branches" do | |
| 118 | + get api("/projects/#{project.id}/repository/compare", user), from: 'master', to: 'simple_merge_request' | |
| 119 | + response.status.should == 200 | |
| 120 | + json_response['commits'].size.should == 3 | |
| 121 | + end | |
| 122 | + | |
| 123 | + it "should compare 2 commits" do | |
| 124 | + get api("/projects/#{project.id}/repository/compare", user), from: 'b1e6a9dbf1c85', to: '1e689bfba395' | |
| 125 | + response.status.should == 200 | |
| 126 | + json_response['commits'].size.should == 0 | |
| 127 | + end | |
| 128 | + | |
| 129 | + it "should compare 2 commits" do | |
| 130 | + get api("/projects/#{project.id}/repository/compare", user), from: '1e689bfba395', to: 'b1e6a9dbf1c85' | |
| 131 | + response.status.should == 200 | |
| 132 | + json_response['commits'].size.should == 4 | |
| 133 | + end | |
| 134 | + end | |
| 115 | 135 | end | ... | ... |