Skip to content

Instantly share code, notes, and snippets.

@ariejan
Created May 1, 2013 19:14
Show Gist options
  • Save ariejan/5497596 to your computer and use it in GitHub Desktop.
Save ariejan/5497596 to your computer and use it in GitHub Desktop.
me
let(:post) { create :post, body: "Blah en *narf*" }
it "let's Kramdown do the heavy lifting" do
kramdown = double
kramdown.should_receive(:to_html)
Kramdown::Document.should_receive(:new).with(post.body).and_return(kramdown)
helper.markdown(post.body)
end
@avdgaag
Copy link

avdgaag commented May 1, 2013

Why spec the helper implementation instead of its behaviour? Also, why use a post at all? Why not say:

expect(helper.markdown("Blah en *narf*")).to eql("<p>Blah en <em>narf</em></p>\n")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment