diff options
author | Rémy Coutable <remy@rymai.me> | 2017-06-29 12:53:55 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-06-29 12:53:55 +0000 |
commit | 572fa2cb0263b87b5323ebb0d72bc71fa252df78 (patch) | |
tree | bc9422f43dcfdd47a888874bbdd26f5cda13f683 /spec/lib | |
parent | 4f1d3c62f58aec2d795c0b4546bb5d69b2317d65 (diff) | |
parent | 5681bf63490a945df6a70c85bebd94f376181307 (diff) | |
download | gitlab-ce-572fa2cb0263b87b5323ebb0d72bc71fa252df78.tar.gz |
Merge branch '34280-gitalyclient-sort_by_param-invalid-sort_by-key-recently_updated' into 'master'
Fix a bug where an invalid sort param value was passed to Gitaly
Closes #34280
See merge request !12534
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/gitaly_client/ref_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client/ref_spec.rb b/spec/lib/gitlab/gitaly_client/ref_spec.rb index 42dba2ff874..8ad39a02b93 100644 --- a/spec/lib/gitlab/gitaly_client/ref_spec.rb +++ b/spec/lib/gitlab/gitaly_client/ref_spec.rb @@ -69,6 +69,15 @@ describe Gitlab::GitalyClient::Ref do client.local_branches(sort_by: 'updated_desc') end + it 'translates known mismatches on sort param values' do + expect_any_instance_of(Gitaly::Ref::Stub) + .to receive(:find_local_branches) + .with(gitaly_request_with_params(sort_by: :NAME), kind_of(Hash)) + .and_return([]) + + client.local_branches(sort_by: 'name_asc') + end + it 'raises an argument error if an invalid sort_by parameter is passed' do expect { client.local_branches(sort_by: 'invalid_sort') }.to raise_error(ArgumentError) end |