Commit 393801b7 authored by James Lopez's avatar James Lopez

Merge branch...

Merge branch '201763-some-examples-in-ee-spec-controllers-projects-tracings_controller_spec-rb-are-only-passing' into 'master'

Fix a flaky 'Projects::TracingsController' test

Closes #201763

See merge request gitlab-org/gitlab!24301
parents 2e2bbfb7 fdabcf35
...@@ -9,30 +9,36 @@ describe Projects::TracingsController do ...@@ -9,30 +9,36 @@ describe Projects::TracingsController do
shared_examples 'user with read access' do |visibility_level| shared_examples 'user with read access' do |visibility_level|
let(:project) { create(:project, visibility_level) } let(:project) { create(:project, visibility_level) }
before do %w[developer maintainer].each do |role|
project.add_maintainer(user) context "with a #{visibility_level} project and #{role} role" do
end before do
project.add_role(user, role)
end
it 'renders OK' do it 'renders OK' do
get :show, params: { namespace_id: project.namespace, project_id: project } get :show, params: { namespace_id: project.namespace, project_id: project }
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:show) expect(response).to render_template(:show)
end
end
end end
end end
shared_examples 'user without read access' do |visibility_level| shared_examples 'user without read access' do |visibility_level|
let(:project) { create(:project, visibility_level) } let(:project) { create(:project, visibility_level) }
%w[guest reporter developer].each do |role| %w[guest reporter].each do |role|
before do context "with a #{visibility_level} project and #{role} role" do
project.public_send("add_#{role}", user) before do
end project.add_role(user, role)
end
it 'returns 404' do it 'returns 404' do
get :show, params: { namespace_id: project.namespace, project_id: project } get :show, params: { namespace_id: project.namespace, project_id: project }
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end
end end
end 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