summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2017-06-28 15:38:00 -0400
committerAlejandro Rodríguez <alejorro70@gmail.com>2017-06-28 15:38:00 -0400
commit5681bf63490a945df6a70c85bebd94f376181307 (patch)
tree321da491ef35258463fdcb8e6076275e46e3a959 /spec/lib
parent9f44687a14d57fec596b9736584bf8718df75a2e (diff)
downloadgitlab-ce-5681bf63490a945df6a70c85bebd94f376181307.tar.gz
Fix a bug where an invalid sort param value was passed to Gitaly34280-gitalyclient-sort_by_param-invalid-sort_by-key-recently_updated
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/gitaly_client/ref_spec.rb9
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