summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <zegerjan@localhost.localdomain>2015-10-01 20:34:23 +0200
committerZeger-Jan van de Weg <mail@zjvandeweg.nl>2015-10-15 21:50:15 +0200
commit3f08e4b186bd02b37f34ccf1bc641a95f9d865ce (patch)
tree139b27b544c27bd67d510c199a23628a089e8624 /spec
parent7248566632d5de39e7b57594dcf6e021ae912282 (diff)
downloadgitlab-ce-3f08e4b186bd02b37f34ccf1bc641a95f9d865ce.tar.gz
Add specs on #license
Diffstat (limited to 'spec')
-rw-r--r--spec/models/repository_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index 05e51532eb8..60b93988476 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -91,4 +91,15 @@ describe Repository do
it { expect(subject.data.lines[2]).to eq(" - Feature: Replace teams with group membership\n") }
end
end
+
+ describe "#license" do
+ it 'test selection preference' do
+ repository.send(:cache).expire(:license)
+ TestBlob = Struct.new(:name)
+ files = [TestBlob.new('file'), TestBlob.new('license'), TestBlob.new('copying')]
+ expect(repository.tree).to receive(:blobs).and_return(files)
+
+ expect(repository.license.name).to eq('license')
+ end
+ end
end