diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-06-06 16:26:31 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-06-08 10:07:17 -0500 |
commit | 369d681eec8177f03bf3b4f694e03098447dae09 (patch) | |
tree | 53b45d655a1598624a743b3348571843538e1caf /spec/models/blob_spec.rb | |
parent | 1bc80c2587323b9107ec3fb2fe6024d7e7817e35 (diff) | |
download | gitlab-ce-369d681eec8177f03bf3b4f694e03098447dae09.tar.gz |
Add Blob#file_type convenience methoddm-blob-file-type
Diffstat (limited to 'spec/models/blob_spec.rb')
-rw-r--r-- | spec/models/blob_spec.rb | 8 |
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 |