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

This commit is contained in:
Tiago Botelho 2017-06-29 07:56:48 +01:00
parent eb175d5fe0
commit 7b77e2862a
2 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,5 @@
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

View File

@ -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