diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-09 18:09:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-09 18:09:29 +0300 |
commit | 209bd8cf1f542f6ba2a069b368a9187faa871e96 (patch) | |
tree | 6b77dc8183135b8316cc70c8dbc9c4e7c18cf05a /spec/models | |
parent | a9ced7da447785c57477b3d8dbccc73a78cface1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/ci/build_dependencies_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/ci/processable_spec.rb | 14 | ||||
-rw-r--r-- | spec/models/merge_request_spec.rb | 25 | ||||
-rw-r--r-- | spec/models/snippet_spec.rb | 2 |
4 files changed, 23 insertions, 26 deletions
diff --git a/spec/models/ci/build_dependencies_spec.rb b/spec/models/ci/build_dependencies_spec.rb index 6db69d0f34c..8f2199ac360 100644 --- a/spec/models/ci/build_dependencies_spec.rb +++ b/spec/models/ci/build_dependencies_spec.rb @@ -96,14 +96,6 @@ describe Ci::BuildDependencies do end it { is_expected.to contain_exactly(build, rspec_test, staging) } - - context 'when ci_dag_support is disabled' do - before do - stub_feature_flags(ci_dag_support: false) - end - - it { is_expected.to contain_exactly(build, rspec_test, rubocop_test, staging) } - end end context 'when need artifacts are defined' do diff --git a/spec/models/ci/processable_spec.rb b/spec/models/ci/processable_spec.rb index e03f54aa728..e8ef7b29681 100644 --- a/spec/models/ci/processable_spec.rb +++ b/spec/models/ci/processable_spec.rb @@ -25,20 +25,6 @@ describe Ci::Processable do it 'returns all needs' do expect(with_aggregated_needs.first.aggregated_needs_names).to contain_exactly('test1', 'test2') end - - context 'with ci_dag_support disabled' do - before do - stub_feature_flags(ci_dag_support: false) - end - - it 'returns all processables' do - expect(with_aggregated_needs).to contain_exactly(processable) - end - - it 'returns empty needs' do - expect(with_aggregated_needs.first.aggregated_needs_names).to be_nil - end - end end context 'without needs' do diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index bfad1da1e21..50bb194ef71 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -874,7 +874,7 @@ describe MergeRequest do subject(:merge_request) { build(:merge_request) } before do - expect(diff).to receive(:modified_paths).and_return(paths) + allow(diff).to receive(:modified_paths).and_return(paths) end context 'when past_merge_request_diff is specified' do @@ -890,10 +890,29 @@ describe MergeRequest do let(:compare) { double(:compare) } let(:diff) { compare } - it 'returns affected file paths from compare' do + before do merge_request.compare = compare - expect(merge_request.modified_paths).to eq(paths) + expect(merge_request).to receive(:diff_stats).and_return(diff_stats) + end + + context 'and diff_stats are not present' do + let(:diff_stats) { nil } + + it 'returns affected file paths from compare' do + expect(merge_request.modified_paths).to eq(paths) + end + end + + context 'and diff_stats are present' do + let(:diff_stats) { double(:diff_stats) } + + it 'returns affected file paths from compare' do + diff_stats_path = double(:diff_stats_paths) + expect(diff_stats).to receive(:paths).and_return(diff_stats_path) + + expect(merge_request.modified_paths).to eq(diff_stats_path) + end end end diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb index 8c4d1951697..2061084d5ea 100644 --- a/spec/models/snippet_spec.rb +++ b/spec/models/snippet_spec.rb @@ -703,7 +703,7 @@ describe Snippet do let(:current_size) { 60 } before do - allow(subject.repository).to receive(:_uncached_size).and_return(current_size) + allow(subject.repository).to receive(:size).and_return(current_size) end it 'sets up size checker', :aggregate_failures do |