summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-24 09:32:10 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-24 09:55:01 -0600
commita530e9da3580e05a171b3ba0a3f4408afc000b10 (patch)
tree49e3787d12d2e7d3a40e3cdf1af0ff8643ac99e1 /spec
parent9e39b317a3865688e9fb204fb8680d3e91958fec (diff)
downloadgitlab-ce-a530e9da3580e05a171b3ba0a3f4408afc000b10.tar.gz
Address review
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/git/index_spec.rb10
-rw-r--r--spec/models/repository_spec.rb4
2 files changed, 12 insertions, 2 deletions
diff --git a/spec/lib/gitlab/git/index_spec.rb b/spec/lib/gitlab/git/index_spec.rb
index 91ffbd138ce..d0c7ca60ddc 100644
--- a/spec/lib/gitlab/git/index_spec.rb
+++ b/spec/lib/gitlab/git/index_spec.rb
@@ -92,6 +92,16 @@ describe Gitlab::Git::Index, seed_helper: true do
expect { index.create_dir(options) }.to raise_error('Directory already exists as a file')
end
end
+
+ context 'when a directory at that path exists' do
+ before do
+ options[:file_path] = 'files/executables'
+ end
+
+ it 'raises an error' do
+ expect { index.create_dir(options) }.to raise_error('Directory already exists')
+ end
+ end
end
describe '#update' do
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 58943fd7252..ae203fada12 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -291,7 +291,7 @@ describe Repository, models: true do
end
end
- describe "#commit_dir" do
+ describe "#create_dir" do
it "commits a change that creates a new directory" do
expect do
repository.create_dir(user, 'newdir',
@@ -424,7 +424,7 @@ describe Repository, models: true do
end
end
- describe "#remove_file" do
+ describe "#delete_file" do
it 'removes file successfully' do
expect do
repository.delete_file(user, 'README',