tests for markdown

This commit is contained in:
Skud
2013-02-14 11:53:01 +11:00
parent a0955d2bfc
commit 430068458d
3 changed files with 11 additions and 2 deletions

View File

@@ -3,7 +3,8 @@
%p#notice= notice
%p
= @forum.description
:markdown
#{ strip_tags(@forum.description) }
%p
This forum is run by
= link_to @forum.owner, @forum.owner

View File

@@ -10,4 +10,8 @@ describe "forums/index" do
it "renders a list of forums" do
assert_select "h2", :text => @forum1.name, :count => 2
end
it "parses markdown description into html" do
assert_select "em", "Everything"
end
end

View File

@@ -7,10 +7,14 @@ describe "forums/show" do
end
it "renders attributes" do
rendered.should contain @forum.description
rendered.should contain "Everything about permaculture"
rendered.should contain @forum.owner.to_s
end
it "parses markdown description into html" do
assert_select "em", "Everything"
end
it 'links to new post with the forum id' do
assert_select "a[href=#{new_post_path(:forum_id => @forum.id)}]"
end