Skip to content
Snippets Groups Projects
Commit a89cb5cb authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 0d6fa033
No related branches found
No related tags found
No related merge requests found
Showing
with 19 additions and 19 deletions
Loading
Loading
@@ -2264,7 +2264,7 @@ describe NotificationService, :mailer do
end
 
it 'filters out guests when new note is created' do
expect(SentNotification).to receive(:record).with(merge_request, any_args).exactly(1).times
expect(SentNotification).to receive(:record).with(merge_request, any_args).once
 
notification.new_note(note)
 
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ describe Projects::BatchOpenIssuesCountService do
 
let(:subject) { described_class.new([project_1, project_2]) }
 
context '#refresh_cache', :use_clean_rails_memory_store_caching do
describe '#refresh_cache', :use_clean_rails_memory_store_caching do
before do
create(:issue, project: project_1)
create(:issue, project: project_1, confidential: true)
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ describe Projects::HashedStorage::MigrateAttachmentsService do
let(:old_disk_path) { File.join(base_path(legacy_storage), upload.path) }
let(:new_disk_path) { File.join(base_path(hashed_storage), upload.path) }
 
context '#execute' do
describe '#execute' do
context 'when succeeds' do
it 'moves attachments to hashed storage layout' do
expect(File.file?(old_disk_path)).to be_truthy
Loading
Loading
@@ -102,13 +102,13 @@ describe Projects::HashedStorage::MigrateAttachmentsService do
end
end
 
context '#old_disk_path' do
describe '#old_disk_path' do
it 'returns old disk_path for project' do
expect(service.old_disk_path).to eq(project.full_path)
end
end
 
context '#new_disk_path' do
describe '#new_disk_path' do
it 'returns new disk_path for project' do
service.execute
 
Loading
Loading
@@ -116,7 +116,7 @@ describe Projects::HashedStorage::MigrateAttachmentsService do
end
end
 
context '#target_path_discardable?' do
describe '#target_path_discardable?' do
it 'returns true when it include only items on the discardable list' do
hashed_attachments_path = File.join(base_path(hashed_storage))
Projects::HashedStorage::MigrateAttachmentsService::DISCARDABLE_PATHS.each do |path_fragment|
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ describe Projects::HashedStorage::RollbackAttachmentsService do
let(:old_disk_path) { File.join(base_path(hashed_storage), upload.path) }
let(:new_disk_path) { File.join(base_path(legacy_storage), upload.path) }
 
context '#execute' do
describe '#execute' do
context 'when succeeds' do
it 'moves attachments to legacy storage layout' do
expect(File.file?(old_disk_path)).to be_truthy
Loading
Loading
@@ -86,13 +86,13 @@ describe Projects::HashedStorage::RollbackAttachmentsService do
end
end
 
context '#old_disk_path' do
describe '#old_disk_path' do
it 'returns old disk_path for project' do
expect(service.old_disk_path).to eq(project.disk_path)
end
end
 
context '#new_disk_path' do
describe '#new_disk_path' do
it 'returns new disk_path for project' do
service.execute
 
Loading
Loading
Loading
Loading
@@ -75,7 +75,7 @@ describe Projects::HousekeepingService do
 
# At push 200
expect(GitGarbageCollectWorker).to receive(:perform_async).with(project.id, :gc, :the_lease_key, :the_uuid)
.exactly(1).times
.once
# At push 50, 100, 150
expect(GitGarbageCollectWorker).to receive(:perform_async).with(project.id, :full_repack, :the_lease_key, :the_uuid)
.exactly(3).times
Loading
Loading
Loading
Loading
@@ -57,7 +57,7 @@ describe Projects::OpenIssuesCountService, :use_clean_rails_memory_store_caching
end
end
 
context '#refresh_cache' do
describe '#refresh_cache' do
before do
create(:issue, :opened, project: project)
create(:issue, :opened, project: project)
Loading
Loading
Loading
Loading
@@ -1884,7 +1884,7 @@ describe QuickActions::InterpretService do
end
end
 
context "#commands_executed_count" do
describe "#commands_executed_count" do
it 'counts commands executed' do
content = "/close and \n/assign me and \n/title new title"
 
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ RSpec.shared_examples 'issues list service' do
described_class.new(parent, user, params).execute
end
 
context '#metadata' do
describe '#metadata' do
it 'returns issues count for list' do
params = { board_id: board.id, id: list1.id }
 
Loading
Loading
Loading
Loading
@@ -16,10 +16,10 @@ describe 'gitlab:cleanup rake tasks' do
let!(:logger) { double(:logger) }
 
before do
expect(main_object).to receive(:logger).and_return(logger).at_least(1).times
expect(main_object).to receive(:logger).and_return(logger).at_least(:once)
 
allow(logger).to receive(:info).at_least(1).times
allow(logger).to receive(:debug).at_least(1).times
allow(logger).to receive(:info).at_least(:once)
allow(logger).to receive(:debug).at_least(:once)
end
 
context 'with a fixable orphaned project upload file' do
Loading
Loading
Loading
Loading
@@ -59,7 +59,7 @@ describe GitlabUploader do
describe '#cache!' do
it 'moves the file from the working directory to the cache directory' do
# One to get the work dir, the other to remove it
expect(subject).to receive(:workfile_path).exactly(2).times.and_call_original
expect(subject).to receive(:workfile_path).twice.and_call_original
# Test https://github.com/carrierwavesubject/carrierwave/blob/v1.0.0/lib/carrierwave/sanitized_file.rb#L200
expect(FileUtils).to receive(:mv).with(anything, /^#{subject.work_dir}/).and_call_original
expect(FileUtils).to receive(:mv).with(/^#{subject.work_dir}/, /#{subject.cache_dir}/).and_call_original
Loading
Loading
Loading
Loading
@@ -37,7 +37,7 @@ describe NamespaceFileUploader do
end
end
 
context '.base_dir' do
describe '.base_dir' do
it 'returns local storage base_dir without store param' do
expect(described_class.base_dir(group)).to eq("uploads/-/system/namespace/#{group.id}")
end
Loading
Loading
Loading
Loading
@@ -31,7 +31,7 @@ describe CreateGpgSignatureWorker do
allow(Gitlab::Gpg::Commit).to receive(:new).and_return(gpg_commit)
allow(Gitlab::Gpg::Commit).to receive(:new).with(commits.first).and_raise(StandardError)
 
expect(gpg_commit).to receive(:signature).exactly(2).times
expect(gpg_commit).to receive(:signature).twice
 
subject
end
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