Skip to content
Snippets Groups Projects
Commit 2675581c authored by Stan Hu's avatar Stan Hu
Browse files

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.
parent cedbb336
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
 
Loading
Loading
@@ -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 }
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment