summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-08-06 02:32:17 +0200
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-08-06 02:32:17 +0200
commit6f9428b1cd66d9f4ded1f1b1ef38e258e2b97c50 (patch)
treee79fb58b0a8e87db2538917afc58f14c1fe7d786 /spec/helpers
parent90c2cd1ee6c6fd018af0fb0dd79e0fb361000668 (diff)
downloadgitlab-ce-6f9428b1cd66d9f4ded1f1b1ef38e258e2b97c50.tar.gz
Fix GFM helper to raise an exception when @project is not set
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/gitlab_flavored_markdown_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/helpers/gitlab_flavored_markdown_spec.rb b/spec/helpers/gitlab_flavored_markdown_spec.rb
index c1d95b8204c..9ba2e911359 100644
--- a/spec/helpers/gitlab_flavored_markdown_spec.rb
+++ b/spec/helpers/gitlab_flavored_markdown_spec.rb
@@ -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 "}"