summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-10-04 12:07:17 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-10-04 12:07:17 +0000
commit27e18f182f7aab81fbe20e4b069e169a29c478ff (patch)
treeed671dffa7a02eaed608a95d2db55771306c1474 /spec/lib
parent22bb4872e657988bb8c133c515e8df4a0ad77785 (diff)
parent147e2b21be180d4b405c6ebe861971cb0dc9e6b2 (diff)
downloadgitlab-ce-27e18f182f7aab81fbe20e4b069e169a29c478ff.tar.gz
Merge branch 'gitaly-fetch-ref' into 'master'
Let fetch_ref pull from Gitaly instead of from disk Closes gitaly#585 See merge request gitlab-org/gitlab-ce!14588
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb
index f405b2f2684..5f12125beb2 100644
--- a/spec/lib/gitlab/git/repository_spec.rb
+++ b/spec/lib/gitlab/git/repository_spec.rb
@@ -1472,6 +1472,23 @@ describe Gitlab::Git::Repository, seed_helper: true do
end
end
+ describe '#write_ref' do
+ context 'validations' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:ref_path, :ref) do
+ 'foo bar' | '123'
+ 'foobar' | "12\x003"
+ end
+
+ with_them do
+ it 'raises ArgumentError' do
+ expect { repository.write_ref(ref_path, ref) }.to raise_error(ArgumentError)
+ end
+ end
+ end
+ end
+
def create_remote_branch(repository, remote_name, branch_name, source_branch_name)
source_branch = repository.branches.find { |branch| branch.name == source_branch_name }
rugged = repository.rugged