diff options
Diffstat (limited to 'spec/lib/gitlab/git/repository_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 354260f23f6..04a648a0da0 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -2254,7 +2254,7 @@ describe Gitlab::Git::Repository, :seed_helper do end describe '#remove' do - let(:project) { create(:project, :repository)} + let(:project) { create(:project, :repository) } let(:repository) { project.repository } it 'removes the repository' do @@ -2264,5 +2264,17 @@ describe Gitlab::Git::Repository, :seed_helper do expect(repository.raw_repository.exists?).to be false end + + context 'when the repository does not exist' do + let(:repository) { create(:project).repository } + + it 'is idempotent' do + expect(repository.exists?).to be false + + repository.remove + + expect(repository.raw_repository.exists?).to be false + end + end end end |