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