Skip to content

Instantly share code, notes, and snippets.

@weiying-chen
Created November 29, 2012 11:05
Show Gist options
  • Select an option

  • Save weiying-chen/4168236 to your computer and use it in GitHub Desktop.

Select an option

Save weiying-chen/4168236 to your computer and use it in GitHub Desktop.
posts/show.html.erb:
<p><%= raw @post.tags.map { |t| link_to t.name, tag_path(t.name) }.join(', ') %></p>
post_pages_spec.rb:
it { find("p").should have_content(post.tags.map { |t| t.name }.join(", ")) }
Failures:
1) Post pages show page
Failure/Error: it { find("p").should have_content(post.tags.map { |t| t.name }.join(", ")) }
expected there to be content "1, tag28" in "Lorem ipsum"
# ./spec/requests/post_pages_spec.rb:28:in `block (3 levels) in <top (required)>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment