summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-06-08 17:15:16 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-06-08 17:15:16 +0000
commit6cbe38675dcd0547d9127373851471008e624e2b (patch)
tree82a89b246a2fa06a0eee9756929e06e059c17a7d /spec
parent299a3a9aa0a91229f2767113145c3166ac642379 (diff)
parent369d681eec8177f03bf3b4f694e03098447dae09 (diff)
downloadgitlab-ce-6cbe38675dcd0547d9127373851471008e624e2b.tar.gz
Merge branch 'dm-blob-file-type' into 'master'
Add Blob#file_type convenience method See merge request !11982
Diffstat (limited to 'spec')
-rw-r--r--spec/models/blob_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/blob_spec.rb b/spec/models/blob_spec.rb
index f19e1af65a6..e1193e0d19a 100644
--- a/spec/models/blob_spec.rb
+++ b/spec/models/blob_spec.rb
@@ -199,6 +199,14 @@ describe Blob do
end
end
+ describe '#file_type' do
+ it 'returns the file type' do
+ blob = fake_blob(path: 'README.md')
+
+ expect(blob.file_type).to eq(:readme)
+ end
+ end
+
describe '#simple_viewer' do
context 'when the blob is empty' do
it 'returns an empty viewer' do