diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-27 18:08:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-27 18:08:51 +0300 |
commit | 1ea1db491c8bc90789acda45c9002aaa5c4dc498 (patch) | |
tree | 46d974fed38f2ea63e69bad9d43760c62611c958 /spec/lib/gitlab/gl_repository | |
parent | 22e9af3c8b8aedf7f46b786be968862b74a2d07e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/gl_repository')
-rw-r--r-- | spec/lib/gitlab/gl_repository/repo_type_spec.rb | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/spec/lib/gitlab/gl_repository/repo_type_spec.rb b/spec/lib/gitlab/gl_repository/repo_type_spec.rb index 9e09e1411ab..8bbcc644f6d 100644 --- a/spec/lib/gitlab/gl_repository/repo_type_spec.rb +++ b/spec/lib/gitlab/gl_repository/repo_type_spec.rb @@ -2,33 +2,45 @@ require 'spec_helper' describe Gitlab::GlRepository::RepoType do - set(:project) { create(:project) } + let_it_be(:project) { create(:project) } describe Gitlab::GlRepository::PROJECT do it_behaves_like 'a repo type' do let(:expected_identifier) { "project-#{project.id}" } let(:expected_id) { project.id.to_s } - let(:expected_suffix) { "" } + let(:expected_suffix) { '' } let(:expected_repository) { project.repository } + let(:expected_container) { project } end - it "knows its type" do + it 'knows its type' do expect(described_class).not_to be_wiki expect(described_class).to be_project end + + it 'checks if repository path is valid' do + expect(described_class.valid?(project.repository.full_path)).to be_truthy + expect(described_class.valid?(project.wiki.repository.full_path)).to be_truthy + end end describe Gitlab::GlRepository::WIKI do it_behaves_like 'a repo type' do let(:expected_identifier) { "wiki-#{project.id}" } let(:expected_id) { project.id.to_s } - let(:expected_suffix) { ".wiki" } + let(:expected_suffix) { '.wiki' } let(:expected_repository) { project.wiki.repository } + let(:expected_container) { project } end - it "knows its type" do + it 'knows its type' do expect(described_class).to be_wiki expect(described_class).not_to be_project end + + it 'checks if repository path is valid' do + expect(described_class.valid?(project.repository.full_path)).to be_falsey + expect(described_class.valid?(project.wiki.repository.full_path)).to be_truthy + end end end |