diff options
author | Stan Hu <stanhu@gmail.com> | 2015-02-28 04:17:57 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-03-10 18:11:20 +0300 |
commit | 4218a2bfcf7a3f864268c3eafe8ead28bb7808d8 (patch) | |
tree | d3860750b344916b1461386ac68990d8d42f439c /spec/helpers/events_helper_spec.rb | |
parent | 332413d7c4003c3718f8d91c54d7f3410710a5f9 (diff) |
Fix code preview theme setting for comments, issues, merge requests, and snippets.
Also preserve code preview color scheme in events dashboard.
Assign default colors to all code blocks shown as <pre class="code highlight [color_scheme]">
Closes #1139
Diffstat (limited to 'spec/helpers/events_helper_spec.rb')
-rw-r--r-- | spec/helpers/events_helper_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb index c4a192ac1aa..b392371deb4 100644 --- a/spec/helpers/events_helper_spec.rb +++ b/spec/helpers/events_helper_spec.rb @@ -4,6 +4,8 @@ describe EventsHelper do include ApplicationHelper include GitlabMarkdownHelper + let(:current_user) { create(:user, email: "current@email.com") } + it 'should display one line of plain text without alteration' do input = 'A short, plain note' expect(event_note(input)).to match(input) @@ -50,4 +52,14 @@ describe EventsHelper do expect(event_note(input)).to match(link_url) expect(event_note(input)).to match(expected_link_text) end + + it 'should preserve code color scheme' do + input = "```ruby\ndef test\n 'hello world'\nend\n```" + expected = '<pre class="code highlight white ruby">' \ + "<code><span class=\"k\">def</span> <span class=\"nf\">test</span>\n" \ + " <span class=\"s1\">\'hello world\'</span>\n" \ + "<span class=\"k\">end</span>\n" \ + '</code></pre>' + expect(event_note(input)).to eq(expected) + end end |