debian-mirror-gitlab/spec/frontend/fixtures/api_merge_requests.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
1.1 KiB
Ruby
Raw Normal View History

2020-10-24 23:57:45 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
include ApiHelpers
include JavaScriptFixturesHelpers
2021-03-11 19:13:27 +05:30
let_it_be(:admin) { create(:admin, name: 'root') }
2023-01-13 00:05:48 +05:30
let_it_be(:namespace) { create(:namespace, name: 'gitlab-test') }
2021-03-11 19:13:27 +05:30
let_it_be(:project) { create(:project, :repository, namespace: namespace, path: 'lorem-ipsum') }
2022-07-16 23:28:13 +05:30
let_it_be(:early_mrs) do
4.times { |i| create(:merge_request, source_project: project, source_branch: "branch-#{i}") }
end
2021-03-11 19:13:27 +05:30
let_it_be(:mr) { create(:merge_request, source_project: project) }
2020-10-24 23:57:45 +05:30
it 'api/merge_requests/get.json' do
get api("/projects/#{project.id}/merge_requests", admin)
expect(response).to be_successful
end
2021-03-11 19:13:27 +05:30
it 'api/merge_requests/versions.json' do
get api("/projects/#{project.id}/merge_requests/#{mr.iid}/versions", admin)
expect(response).to be_successful
end
it 'api/merge_requests/changes.json' do
get api("/projects/#{project.id}/merge_requests/#{mr.iid}/changes", admin)
expect(response).to be_successful
end
2020-10-24 23:57:45 +05:30
end