summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2016-06-22 12:53:58 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2016-06-27 14:17:49 -0700
commit66b37149eb72179e1b6329221b8a92e226e4e563 (patch)
tree1f1b9e12320bf54301964f0bc8f11b2970a9ea47 /spec/lib
parente7b512efa65aebe26cd0240a4d077475c42761c1 (diff)
downloadgitlab-ce-66b37149eb72179e1b6329221b8a92e226e4e563.tar.gz
support cgi style options, such as erb?parent=json
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/highlight_spec.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/lib/gitlab/highlight_spec.rb b/spec/lib/gitlab/highlight_spec.rb
index c84911e8f0b..364532e94e3 100644
--- a/spec/lib/gitlab/highlight_spec.rb
+++ b/spec/lib/gitlab/highlight_spec.rb
@@ -21,7 +21,6 @@ describe Gitlab::Highlight, lib: true do
describe 'custom highlighting from .gitattributes' do
let(:branch) { 'gitattributes' }
- let(:path) { 'custom-highlighting/test.gitlab-custom' }
let(:blob) { repository.blob_at_branch(branch, path) }
let(:highlighter) do
@@ -30,8 +29,20 @@ describe Gitlab::Highlight, lib: true do
before { project.change_head('gitattributes') }
- it 'highlights as ruby' do
- expect(highlighter.lexer.tag).to eq 'ruby'
+ describe 'basic language selection' do
+ let(:path) { 'custom-highlighting/test.gitlab-custom' }
+ it 'highlights as ruby' do
+ expect(highlighter.lexer.tag).to eq 'ruby'
+ end
+ end
+
+ describe 'cgi options' do
+ let(:path) { 'custom-highlighting/test.gitlab-cgi' }
+
+ it 'highlights as json with erb' do
+ expect(highlighter.lexer.tag).to eq 'erb'
+ expect(highlighter.lexer.parent.tag).to eq 'json'
+ end
end
end
end