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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-04-23 18:48:26 +0300
committerNick Thomas <nick@gitlab.com>2018-04-23 18:48:26 +0300
commitab286656b22dd686a659afe908daade6e5a54ff3 (patch)
tree538fb10cb2979c616754e492d8fe44500e760a37 /spec/models/user_spec.rb
parent3d12ce95b1307f9b8439aab9ac5fe9d406ab9b01 (diff)
Resolve "Namespace factory is problematic"
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 35db7616efb..3f2eb58f009 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -1164,8 +1164,12 @@ describe User do
end
context 'with a group route matching the given path' do
+ let!(:group) { create(:group, path: 'group_path') }
+
context 'when the group namespace has an owner_id (legacy data)' do
- let!(:group) { create(:group, path: 'group_path', owner: user) }
+ before do
+ group.update!(owner_id: user.id)
+ end
it 'returns nil' do
expect(described_class.find_by_full_path('group_path')).to eq(nil)
@@ -1173,8 +1177,6 @@ describe User do
end
context 'when the group namespace does not have an owner_id' do
- let!(:group) { create(:group, path: 'group_path') }
-
it 'returns nil' do
expect(described_class.find_by_full_path('group_path')).to eq(nil)
end