Commit 75eb32b7 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Make sure the user won't create another namespace

This fixed https://gitlab.com/gitlab-org/gitlab-ee/-/jobs/32313185
and this only happened on MySQL, because without this, the user
would have another namespace, and both namespaces are belonging
to the user here. However user.namespace would only return one
namespace, which one is database dependent. Even worse, since
there's no ORDER BY, it should be considered completely random.

We should refactor User#ensure_namespace_correct in the future.
parent 051aca5e
require 'spec_helper'
feature 'Profile > Pipeline Quota' do
before do
# This would make sure that the user won't try to create another namespace
allow_any_instance_of(User).to receive(:ensure_namespace_correct)
end
let(:user) { create(:user) }
let(:namespace) { create(:namespace, owner: user) }
let!(:project) { create(:project, namespace: namespace, shared_runners_enabled: true) }
......
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