Skip to content
Snippets Groups Projects
Commit 04bad825 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fixed markdown tests

parent 6171a4d8
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -42,21 +42,6 @@ module ApplicationHelper
grouped_options_for_select(options, @ref || @project.default_branch)
end
 
def markdown(text)
@__renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::GitlabHTML.new(self, filter_html: true, with_toc_data: true), {
no_intra_emphasis: true,
tables: true,
fenced_code_blocks: true,
autolink: true,
strikethrough: true,
lax_html_blocks: true,
space_after_headers: true,
superscript: true
})
@__renderer.render(text).html_safe
end
def search_autocomplete_source
projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } }
default_nav = [
Loading
Loading
Loading
Loading
@@ -78,4 +78,19 @@ module GitlabMarkdownHelper
 
link_to(gfm_body.html_safe, url, html_options)
end
def markdown(text)
@__renderer ||= Redcarpet::Markdown.new(Redcarpet::Render::GitlabHTML.new(self, filter_html: true, with_toc_data: true), {
no_intra_emphasis: true,
tables: true,
fenced_code_blocks: true,
autolink: true,
strikethrough: true,
lax_html_blocks: true,
space_after_headers: true,
superscript: true
})
@__renderer.render(text).html_safe
end
end
require "spec_helper"
 
describe ApplicationHelper do
describe GitlabMarkdownHelper do
before do
@project = Project.find_by_path("gitlabhq") || Factory(:project)
@commit = @project.repo.commits.first.parents.first
Loading
Loading
@@ -10,10 +10,10 @@ describe ApplicationHelper do
end
 
describe "#gfm" do
it "should raiase an error if @project is not set" do
it "should return text if @project is not set" do
@project = nil
 
expect { gfm("foo") }.to raise_error
gfm("foo").should == "foo"
end
 
describe "referencing a commit" do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment