diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-03 16:32:32 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-04 23:49:42 +0300 |
commit | 67815272dceb971c03bea3490ec26529b48a52b4 (patch) | |
tree | 455f30ba7fa73b94844e5ed36041d61c43f6e92b /spec/controllers/groups_controller_spec.rb | |
parent | 167fd71348d145c6fee953004bf77ceebf6efb1e (diff) |
Return an empty array when no matches are found
Diffstat (limited to 'spec/controllers/groups_controller_spec.rb')
-rw-r--r-- | spec/controllers/groups_controller_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index 00a6fa885bf..8582f31f059 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -331,6 +331,16 @@ describe GroupsController do expect(response).to have_http_status(200) end + it 'returns an empty array when there are no search results' do + subgroup = create(:group, :public, parent: group) + l2_subgroup = create(:group, :public, parent: subgroup) + create(:project, :public, namespace: l2_subgroup, name: 'no-match') + + get :children, id: subgroup.to_param, filter: 'test', format: :json + + expect(json_response).to eq([]) + end + it 'includes pagination headers' do 2.times { |i| create(:group, :public, parent: public_subgroup, name: "filterme#{i}") } |