Commit fdabcf35 authored by Rémy Coutable's avatar Rémy Coutable

Fix a flaky 'Projects::TracingsController' test

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 07bd816e
......@@ -9,30 +9,36 @@ describe Projects::TracingsController do
shared_examples 'user with read access' do |visibility_level|
let(:project) { create(:project, visibility_level) }
before do
project.add_maintainer(user)
end
%w[developer maintainer].each do |role|
context "with a #{visibility_level} project and #{role} role" do
before do
project.add_role(user, role)
end
it 'renders OK' do
get :show, params: { namespace_id: project.namespace, project_id: project }
it 'renders OK' do
get :show, params: { namespace_id: project.namespace, project_id: project }
expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:show)
expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:show)
end
end
end
end
shared_examples 'user without read access' do |visibility_level|
let(:project) { create(:project, visibility_level) }
%w[guest reporter developer].each do |role|
before do
project.public_send("add_#{role}", user)
end
%w[guest reporter].each do |role|
context "with a #{visibility_level} project and #{role} role" do
before do
project.add_role(user, role)
end
it 'returns 404' do
get :show, params: { namespace_id: project.namespace, project_id: project }
it 'returns 404' do
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
......
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