diff options
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 |