summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2019-01-25 18:35:05 +0000
committerPhil Hughes <me@iamphill.com>2019-01-25 18:35:05 +0000
commit7c7916baee74e2532e77a94b84e8775a6a8dc2e5 (patch)
tree9b5dd216201fabf56d92d6e17c147f2974a02b35 /spec
parentbf2fe35e2d65583022828d61766f7e63ca7d2670 (diff)
parent1b93b3b640c6dd6377bdddb8beb77f7c3d0da3fc (diff)
downloadgitlab-ce-7c7916baee74e2532e77a94b84e8775a6a8dc2e5.tar.gz
Merge branch 'osw-adjusts-suggestions-unable-to-be-applied' into 'master'
Adjusts suggestions unable to be applied Closes #56690 See merge request gitlab-org/gitlab-ce!24603
Diffstat (limited to 'spec')
-rw-r--r--spec/services/suggestions/apply_service_spec.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/spec/services/suggestions/apply_service_spec.rb b/spec/services/suggestions/apply_service_spec.rb
index e5ca1c155ed..8e77d582eb4 100644
--- a/spec/services/suggestions/apply_service_spec.rb
+++ b/spec/services/suggestions/apply_service_spec.rb
@@ -134,12 +134,11 @@ describe Suggestions::ApplyService do
end
end
- context 'when diff ref from position is different from repo diff refs' do
+ context 'when HEAD from position is different from source branch HEAD on repo' do
it 'returns error message' do
- outdated_refs = Gitlab::Diff::DiffRefs.new(base_sha: 'foo', start_sha: 'bar', head_sha: 'outdated')
-
allow(suggestion).to receive(:appliable?) { true }
- allow(suggestion.position).to receive(:diff_refs) { outdated_refs }
+ allow(suggestion.position).to receive(:head_sha) { 'old-sha' }
+ allow(suggestion.noteable).to receive(:source_branch_sha) { 'new-sha' }
result = subject.execute(suggestion)