diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-03-01 20:10:39 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-03-01 20:10:39 +0300 |
commit | 52e133d17627396f29c1875b972534eaba4a837e (patch) | |
tree | 36b0c306afe21a270ce0f0fe9b396607778bc271 /spec/lib/gitlab/git | |
parent | b19a14473099073dff3e770c00f73ddab4a0a414 (diff) | |
parent | 34fbade4ae67b56061da89fc881781352880b4ed (diff) |
Merge branch 'zj-licensee-key' into 'master'
Client implementation for Licensee#key
See merge request gitlab-org/gitlab-ce!17449
Diffstat (limited to 'spec/lib/gitlab/git')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 8e585d9a81c..25defb98b7c 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -1689,6 +1689,35 @@ describe Gitlab::Git::Repository, seed_helper: true do end end + describe '#license_short_name' do + shared_examples 'acquiring the Licensee license key' do + subject { repository.license_short_name } + + context 'when no license file can be found' do + let(:project) { create(:project, :repository) } + let(:repository) { project.repository.raw_repository } + + before do + project.repository.delete_file(project.owner, 'LICENSE', message: 'remove license', branch_name: 'master') + end + + it { is_expected.to be_nil } + end + + context 'when an mit license is found' do + it { is_expected.to eq('mit') } + end + end + + context 'when gitaly is enabled' do + it_behaves_like 'acquiring the Licensee license key' + end + + context 'when gitaly is disabled', :disable_gitaly do + it_behaves_like 'acquiring the Licensee license key' + end + end + describe '#with_repo_branch_commit' do context 'when comparing with the same repository' do let(:start_repository) { repository } |