diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-11-06 13:39:36 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-11-06 13:39:36 +0300 |
commit | d4ceec9d47a7da5fa17cb6e161ac491e13fcb8bd (patch) | |
tree | 2e7170aed7ea79da51f7693eeda32e8cc29fcc43 /spec/models | |
parent | 46dc343f605f0c98d2b9ec44617d313a1548b4e2 (diff) | |
parent | fe4874c43d3387aed52d95bc2892b27e551ac7a9 (diff) |
Merge branch 'ce-gitlab-git-backport' into 'master'
CE repository mirroring changes backport
See merge request gitlab-org/gitlab-ce!15184
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/repository_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index d7c07676911..8a6aa767ce6 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -2298,4 +2298,24 @@ describe Repository do project.commit_by(oid: '1' * 40) end end + + describe '#raw_repository' do + subject { repository.raw_repository } + + it 'returns a Gitlab::Git::Repository representation of the repository' do + expect(subject).to be_a(Gitlab::Git::Repository) + expect(subject.relative_path).to eq(project.disk_path + '.git') + expect(subject.gl_repository).to eq("project-#{project.id}") + end + + context 'with a wiki repository' do + let(:repository) { project.wiki.repository } + + it 'creates a Gitlab::Git::Repository with the proper attributes' do + expect(subject).to be_a(Gitlab::Git::Repository) + expect(subject.relative_path).to eq(project.disk_path + '.wiki.git') + expect(subject.gl_repository).to eq("wiki-#{project.id}") + end + end + end end |