Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-03-30 15:28:37 +0300
committerStan Hu <stanhu@gmail.com>2019-03-30 15:28:37 +0300
commit2675581cb9dbc37c81732ac69e2166da6ced0429 (patch)
treed559d6373323769793d380b842915f2f0eec17be
parentcedbb3366bf3dd9bafe95dde366c1e28ee70c615 (diff)
Revise merged branch check to green light up to N branches
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 }