BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6f9428b1
Commit
6f9428b1
authored
Aug 06, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix GFM helper to raise an exception when @project is not set
parent
90c2cd1e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
application_helper.rb
app/helpers/application_helper.rb
+1
-0
gitlab_flavored_markdown_spec.rb
spec/helpers/gitlab_flavored_markdown_spec.rb
+6
-0
No files found.
app/helpers/application_helper.rb
View file @
6f9428b1
...
...
@@ -44,6 +44,7 @@ module ApplicationHelper
def
gfm
(
text
,
html_options
=
{})
return
text
if
text
.
nil?
raise
"@project is not set"
if
@project
.
nil?
# Extract pre blocks
# from http://github.github.com/github-flavored-markdown/
...
...
spec/helpers/gitlab_flavored_markdown_spec.rb
View file @
6f9428b1
...
...
@@ -10,6 +10,12 @@ describe ApplicationHelper do
end
describe
"#gfm"
do
it
"should raiase an error if @project is not set"
do
@project
=
nil
expect
{
gfm
(
"foo"
)
}.
to
raise_error
end
describe
"referencing a commit"
do
it
"should link using a full id"
do
gfm
(
"Reverts changes from
#{
@commit
.
id
}
"
).
should
==
"Reverts changes from
#{
link_to
@commit
.
id
,
project_commit_path
(
@project
,
:id
=>
@commit
.
id
),
:title
=>
"Commit:
#{
@commit
.
author_name
}
-
#{
@commit
.
title
}
"
,
:class
=>
"gfm gfm-commit "
}
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment