Skip to content

Commit

Permalink
Move specs to test generate_html
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick Francois committed Sep 10, 2013
1 parent 68b28b3 commit e33e2e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
16 changes: 16 additions & 0 deletions spec/models/content_spec.rb
Expand Up @@ -2,6 +2,7 @@
require 'spec_helper'

describe Content do
context "with a simple blog" do
let!(:blog) { create(:blog) }

describe "#short_url" do
Expand Down Expand Up @@ -95,5 +96,20 @@
end
end
end
end

describe :generate_html do
context "with a blog with textile filter" do
let!(:blog) { create(:blog, comment_text_filter: 'textile') }

context "comment with italic and bold" do
let(:comment) {build(:comment, body: 'Comment body _italic_ *bold*')}

it { expect(comment.generate_html(:body)).to match(/\<em\>italic\<\/em\>/) }
it { expect(comment.generate_html(:body)).to match(/\<strong\>bold\<\/strong\>/) }
end
end

end
end

7 changes: 0 additions & 7 deletions spec/views/articles/read_spec.rb
Expand Up @@ -44,13 +44,6 @@
rendered.should_not have_selector("p>p", :content => "extended content")
end

# FIXME: Move comment partial specs to their own spec file.
it "should not have too many paragraph marks around comment contents" do
rendered.should have_selector("p>em", :content => "italic")
rendered.should have_selector("p>strong", :content => "bold")
rendered.should_not have_selector("p>p>em", :content => "italic")
end

it "should show the comment creation times in the comment list" do
rendered.should =~ /#{@c1.created_at.to_s}/
rendered.should =~ /#{@c2.created_at.to_s}/
Expand Down

0 comments on commit e33e2e3

Please sign in to comment.