summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-03-30 05:28:37 -0700
committerStan Hu <stanhu@gmail.com>2019-03-30 05:28:37 -0700
commit2675581cb9dbc37c81732ac69e2166da6ced0429 (patch)
treed559d6373323769793d380b842915f2f0eec17be
parentcedbb3366bf3dd9bafe95dde366c1e28ee70c615 (diff)
downloadgitlab-ce-sh-fix-project-branches-merge-status.tar.gz
Revise merged branch check to green light up to N branchessh-fix-project-branches-merge-status
The main point of this check is to ensure we aren't checking all branches, not that we have an exact count.
-rw-r--r--spec/requests/api/branches_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/requests/api/branches_spec.rb b/spec/requests/api/branches_spec.rb
index 75dcedabf96..8b503777443 100644
--- a/spec/requests/api/branches_spec.rb
+++ b/spec/requests/api/branches_spec.rb
@@ -20,9 +20,9 @@ describe API::Branches do
let(:route) { "/projects/#{project_id}/repository/branches" }
shared_examples_for 'repository branches' do
- RSpec::Matchers.define :has_merged_branch_names_count do |expected|
+ RSpec::Matchers.define :has_up_to_merged_branch_names_count do |expected|
match do |actual|
- actual[:merged_branch_names].count == expected
+ expected >= actual[:merged_branch_names].count
end
end
@@ -45,7 +45,7 @@ describe API::Branches do
end
it 'determines only a limited number of merged branch names' do
- expect(API::Entities::Branch).to receive(:represent).with(anything, has_merged_branch_names_count(1)).and_call_original
+ expect(API::Entities::Branch).to receive(:represent).with(anything, has_up_to_merged_branch_names_count(2)).and_call_original
get api(route, current_user), params: { per_page: 2 }