summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2014-08-11 08:50:56 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2014-08-11 08:50:56 +0200
commit99eb283101108f1f95e95ade8c1352f547578b26 (patch)
treeed682bc2303d6862af4f2dbd5dd764d7c1e36f31 /spec
parent0e3f8ea2ef2a7d6cc51ccb5d7ae854c6244b40eb (diff)
downloadgitlab-ce-99eb283101108f1f95e95ade8c1352f547578b26.tar.gz
Use readme we support to render if there are multiple readmes
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/tree_helper_spec.rb16
-rw-r--r--spec/lib/gitlab/gitlab_markdown_helper_spec.rb28
2 files changed, 28 insertions, 16 deletions
diff --git a/spec/helpers/tree_helper_spec.rb b/spec/helpers/tree_helper_spec.rb
deleted file mode 100644
index 872dc2ebf31..00000000000
--- a/spec/helpers/tree_helper_spec.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require 'spec_helper'
-
-describe TreeHelper do
- describe '#markup?' do
- %w(textile rdoc org creole wiki mediawiki
- rst adoc asciidoc asc).each do |type|
- it "returns true for #{type} files" do
- markup?("README.#{type}").should be_true
- end
- end
-
- it "returns false when given a non-markup filename" do
- markup?('README.rb').should_not be_true
- end
- end
-end
diff --git a/spec/lib/gitlab/gitlab_markdown_helper_spec.rb b/spec/lib/gitlab/gitlab_markdown_helper_spec.rb
new file mode 100644
index 00000000000..540618a5603
--- /dev/null
+++ b/spec/lib/gitlab/gitlab_markdown_helper_spec.rb
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+describe Gitlab::MarkdownHelper do
+ describe '#markup?' do
+ %w(textile rdoc org creole wiki
+ mediawiki rst adoc asciidoc asc).each do |type|
+ it "returns true for #{type} files" do
+ Gitlab::MarkdownHelper.markup?("README.#{type}").should be_true
+ end
+ end
+
+ it 'returns false when given a non-markup filename' do
+ Gitlab::MarkdownHelper.markup?('README.rb').should_not be_true
+ end
+ end
+
+ describe '#gitlab_markdown?' do
+ %w(mdown md markdown).each do |type|
+ it "returns true for #{type} files" do
+ Gitlab::MarkdownHelper.gitlab_markdown?("README.#{type}").should be_true
+ end
+ end
+
+ it 'returns false when given a non-markdown filename' do
+ Gitlab::MarkdownHelper.gitlab_markdown?('README.rb').should_not be_true
+ end
+ end
+end