Welcome to mirror list, hosted at ThFree Co, Russian Federation.

merge_requests_shared_examples.rb « api « requests « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e6f9e5a434c82649e81e48ca907367552286ab76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

RSpec.shared_examples 'rejects user from accessing merge request info' do
  let(:project) { create(:project, :private) }
  let(:merge_request) do
    create(:merge_request,
      author: user,
      source_project: project,
      target_project: project
    )
  end

  before do
    project.add_guest(user)
  end

  it 'returns a 404 error' do
    get api(url, user)

    expect(response).to have_gitlab_http_status(:not_found)
    expect(json_response['message']).to eq('404 Merge Request Not Found')
  end
end