diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-06-22 22:53:58 +0300 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-06-28 00:17:49 +0300 |
commit | 66b37149eb72179e1b6329221b8a92e226e4e563 (patch) | |
tree | 1f1b9e12320bf54301964f0bc8f11b2970a9ea47 /spec/lib | |
parent | e7b512efa65aebe26cd0240a4d077475c42761c1 (diff) |
support cgi style options, such as erb?parent=json
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/highlight_spec.rb | 17 |
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 |