Commit 0b704d4e authored by Douwe Maan's avatar Douwe Maan

Merge branch 'refactor-namespace-default-scope-override' into 'master'

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

See merge request !12546
parents 2c879643 7b77e286
class Namespace < ActiveRecord::Base
acts_as_paranoid
acts_as_paranoid without_default_scope: true
include CacheMarkdownField
include Sortable
......@@ -47,8 +47,6 @@ class Namespace < ActiveRecord::Base
before_destroy(prepend: true) { prepare_for_destroy }
after_destroy :rm_dir
default_scope { with_deleted }
scope :for_user, -> { where('type IS NULL') }
scope :with_statistics, -> do
......
......@@ -1170,6 +1170,16 @@ describe Project, models: true do
expect(relation.search(project.namespace.name)).to eq([project])
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
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