From 5a7fbb8d89404f27a4467db7f2c619cc56f91142 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Thu, 3 May 2018 08:52:51 +0000 Subject: [Rails5] Fix params passed to MergeWorker --- spec/models/merge_request_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/models') diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index becb146422e..5a9aa7c7d1b 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -1213,7 +1213,7 @@ describe MergeRequest do it 'enqueues MergeWorker job and updates merge_jid' do merge_request = create(:merge_request) user_id = double(:user_id) - params = double(:params) + params = {} merge_jid = 'hash-123' expect(MergeWorker).to receive(:perform_async).with(merge_request.id, user_id, params) do -- cgit v1.2.1 From 812dd06d512ab7774b375ce45aa9235aafc99911 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Fri, 4 May 2018 17:02:08 +0900 Subject: Introduce Redis helpers. Rename BuildTraceChunkFlushToDbWorker to Ci::BuildTraceChunkFlushWorker. --- spec/models/ci/build_trace_chunk_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/models') diff --git a/spec/models/ci/build_trace_chunk_spec.rb b/spec/models/ci/build_trace_chunk_spec.rb index 991f501f633..118b72da11c 100644 --- a/spec/models/ci/build_trace_chunk_spec.rb +++ b/spec/models/ci/build_trace_chunk_spec.rb @@ -75,7 +75,7 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do let(:value) { 'a' * described_class::CHUNK_SIZE } it 'schedules stashing data' do - expect(BuildTraceChunkFlushToDbWorker).to receive(:perform_async).once + expect(Ci::BuildTraceChunkFlushWorker).to receive(:perform_async).once subject end @@ -112,7 +112,7 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do context 'when fullfilled chunk size' do it 'does not schedule stashing data' do - expect(BuildTraceChunkFlushToDbWorker).not_to receive(:perform_async) + expect(Ci::BuildTraceChunkFlushWorker).not_to receive(:perform_async) subject end -- cgit v1.2.1 From 28284c14973a59d5a7f0f8d2862da7f61b101640 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Fri, 4 May 2018 17:42:37 +0900 Subject: Add validation and skip logic at #truncate --- spec/models/ci/build_trace_chunk_spec.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'spec/models') diff --git a/spec/models/ci/build_trace_chunk_spec.rb b/spec/models/ci/build_trace_chunk_spec.rb index 118b72da11c..46d09dff52c 100644 --- a/spec/models/ci/build_trace_chunk_spec.rb +++ b/spec/models/ci/build_trace_chunk_spec.rb @@ -141,11 +141,7 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do context 'when offset is bigger than data size' do let(:offset) { data.bytesize + 1 } - it do - expect_any_instance_of(described_class).not_to receive(:append) { } - - subject - end + it { expect { subject }.to raise_error('Offset is out of range') } end context 'when offset is 10' do -- cgit v1.2.1