diff options
author | Valery Sizov <valery@gitlab.com> | 2016-10-19 15:25:37 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-11-01 15:46:59 +0300 |
commit | a6ba358a8fe5a965a46ca07c8c0382348b2b8d8c (patch) | |
tree | a1ac8c2fe33e9a618a347e890ed9ab6a0cf4bbba /spec/requests/api/merge_request_diffs_spec.rb | |
parent | 957308af84ca8312ea362c7272a4008dac808086 (diff) |
Make specs a bit faster
Diffstat (limited to 'spec/requests/api/merge_request_diffs_spec.rb')
-rw-r--r-- | spec/requests/api/merge_request_diffs_spec.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/requests/api/merge_request_diffs_spec.rb b/spec/requests/api/merge_request_diffs_spec.rb index 8f1e5ac9891..131c2d406ea 100644 --- a/spec/requests/api/merge_request_diffs_spec.rb +++ b/spec/requests/api/merge_request_diffs_spec.rb @@ -14,14 +14,14 @@ describe API::API, 'MergeRequestDiffs', api: true do end describe 'GET /projects/:id/merge_requests/:merge_request_id/versions' do - context 'valid merge request' do - before { get api("/projects/#{project.id}/merge_requests/#{merge_request.id}/versions", user) } - let(:merge_request_diff) { merge_request.merge_request_diffs.first } - - it { expect(response.status).to eq 200 } - it { expect(json_response.size).to eq(merge_request.merge_request_diffs.size) } - it { expect(json_response.first['id']).to eq(merge_request_diff.id) } - it { expect(json_response.first['head_commit_sha']).to eq(merge_request_diff.head_commit_sha) } + it 'returns 200 for a valid merge request' do + get api("/projects/#{project.id}/merge_requests/#{merge_request.id}/versions", user) + merge_request_diff = merge_request.merge_request_diffs.first + + expect(response.status).to eq 200 + expect(json_response.size).to eq(merge_request.merge_request_diffs.size) + expect(json_response.first['id']).to eq(merge_request_diff.id) + expect(json_response.first['head_commit_sha']).to eq(merge_request_diff.head_commit_sha) end it 'returns a 404 when merge_request_id not found' do @@ -31,14 +31,14 @@ describe API::API, 'MergeRequestDiffs', api: true do end describe 'GET /projects/:id/merge_requests/:merge_request_id/versions/:version_id' do - context 'valid merge request' do - before { get api("/projects/#{project.id}/merge_requests/#{merge_request.id}/versions/#{merge_request_diff.id}", user) } - let(:merge_request_diff) { merge_request.merge_request_diffs.first } - - it { expect(response.status).to eq 200 } - it { expect(json_response['id']).to eq(merge_request_diff.id) } - it { expect(json_response['head_commit_sha']).to eq(merge_request_diff.head_commit_sha) } - it { expect(json_response['diffs'].size).to eq(merge_request_diff.diffs.size) } + it 'returns a 200 for a valid merge request' do + merge_request_diff = merge_request.merge_request_diffs.first + get api("/projects/#{project.id}/merge_requests/#{merge_request.id}/versions/#{merge_request_diff.id}", user) + + expect(response.status).to eq 200 + expect(json_response['id']).to eq(merge_request_diff.id) + expect(json_response['head_commit_sha']).to eq(merge_request_diff.head_commit_sha) + expect(json_response['diffs'].size).to eq(merge_request_diff.diffs.size) end it 'returns a 404 when merge_request_id not found' do |