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

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
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
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) }