diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-04-23 18:48:26 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-04-23 18:48:26 +0300 |
commit | ab286656b22dd686a659afe908daade6e5a54ff3 (patch) | |
tree | 538fb10cb2979c616754e492d8fe44500e760a37 /spec/models/user_spec.rb | |
parent | 3d12ce95b1307f9b8439aab9ac5fe9d406ab9b01 (diff) |
Resolve "Namespace factory is problematic"
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 8 |
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 |