提交 2675581c 编写于 作者: S Stan Hu

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.
上级 cedbb336
......@@ -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 }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册