Skip to content
Snippets Groups Projects
Commit 7b77e286 authored by Tiago Botelho's avatar Tiago Botelho
Browse files

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

parent eb175d5f
No related branches found
No related tags found
No related merge requests found
class Namespace < ActiveRecord::Base
acts_as_paranoid
acts_as_paranoid without_default_scope: true
 
include CacheMarkdownField
include Sortable
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment