Commit 7b77e286 authored by Tiago Botelho's avatar Tiago Botelho

Remove Namespace model default scope override and write additional test to Project search

parent eb175d5f
class Namespace < ActiveRecord::Base class Namespace < ActiveRecord::Base
acts_as_paranoid acts_as_paranoid without_default_scope: true
include CacheMarkdownField include CacheMarkdownField
include Sortable include Sortable
...@@ -47,8 +47,6 @@ class Namespace < ActiveRecord::Base ...@@ -47,8 +47,6 @@ class Namespace < ActiveRecord::Base
before_destroy(prepend: true) { prepare_for_destroy } before_destroy(prepend: true) { prepare_for_destroy }
after_destroy :rm_dir after_destroy :rm_dir
default_scope { with_deleted }
scope :for_user, -> { where('type IS NULL') } scope :for_user, -> { where('type IS NULL') }
scope :with_statistics, -> do scope :with_statistics, -> do
......
...@@ -1170,6 +1170,16 @@ describe Project, models: true do ...@@ -1170,6 +1170,16 @@ describe Project, models: true do
expect(relation.search(project.namespace.name)).to eq([project]) expect(relation.search(project.namespace.name)).to eq([project])
end end
describe 'with pending_delete project' do
let(:pending_delete_project) { create(:empty_project, pending_delete: true) }
it 'shows pending deletion project' do
search_result = described_class.search(pending_delete_project.name)
expect(search_result).to eq([pending_delete_project])
end
end
end end
describe '#rename_repo' do describe '#rename_repo' do
......
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