summaryrefslogtreecommitdiff
path: root/spec/models/snippet_spec.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-05-02 10:40:10 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-05-02 10:40:10 +0200
commitd276ea93728e7972ed5b8275460929128d98fccd (patch)
treed6c8188cea2d25685f02c7043f7521f8b1f3509e /spec/models/snippet_spec.rb
parentc9def85844531ffdd2984707a1bc8cbca18f6742 (diff)
parent6068b863c66f785bea0a56881d60e8c23da08a0b (diff)
downloadgitlab-ce-d276ea93728e7972ed5b8275460929128d98fccd.tar.gz
Merge branch 'master' into feature/gb/manual-actions-protected-branches-permissions
* master: (314 commits) Better Explore Groups view Update Carrierwave and fog-core Add specs for Gitlab::RequestProfiler Add scripts/static-analysis to run all the static analysers in one go Shorten and improve some job names Group static-analysis jobs into a single job Don't blow up when email has no References header Update CHANGELOG.md for 9.1.2 Add changelog Add changelog Show Raw button as Download for binary files Use blob viewers for snippets Fix typo Fixed transient failure related to dropdown animations Revert "Merge branch 'tc-no-todo-service-select' into 'master'" fix link to MR 10416 Another change from .click -> .trigger('click') to make spec pass Change from .click -> .trigger('click') to make spec pass Disable AddColumnWithDefaultToLargeTable cop for pre-existing migrations Add AddColumnWithDefaultToLargeTable cop ... Conflicts: spec/requests/api/jobs_spec.rb
Diffstat (limited to 'spec/models/snippet_spec.rb')
-rw-r--r--spec/models/snippet_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/snippet_spec.rb b/spec/models/snippet_spec.rb
index 8095d01b69e..75b1fc7e216 100644
--- a/spec/models/snippet_spec.rb
+++ b/spec/models/snippet_spec.rb
@@ -5,7 +5,6 @@ describe Snippet, models: true do
subject { described_class }
it { is_expected.to include_module(Gitlab::VisibilityLevel) }
- it { is_expected.to include_module(Linguist::BlobHelper) }
it { is_expected.to include_module(Participable) }
it { is_expected.to include_module(Referable) }
it { is_expected.to include_module(Sortable) }
@@ -241,4 +240,16 @@ describe Snippet, models: true do
end
end
end
+
+ describe '#blob' do
+ let(:snippet) { create(:snippet) }
+
+ it 'returns a blob representing the snippet data' do
+ blob = snippet.blob
+
+ expect(blob).to be_a(Blob)
+ expect(blob.path).to eq(snippet.file_name)
+ expect(blob.data).to eq(snippet.content)
+ end
+ end
end