Skip to content

Instantly share code, notes, and snippets.

@steveklabnik
Created January 9, 2012 18:40
Show Gist options
  • Select an option

  • Save steveklabnik/1584277 to your computer and use it in GitHub Desktop.

Select an option

Save steveklabnik/1584277 to your computer and use it in GitHub Desktop.
I think this spec implies that I should commit myself into some kind of rehab.
it "lists them in reverse chronological order" do
recent_titles = Article.for_dashboard.map(&:title).map{|t| Regexp.quote(t) }
title_regex = Regexp.new(recent_titles.join(".*?"), Regexp::MULTILINE)
page.html.should match(title_regex)
end
@steveklabnik
Copy link
Copy Markdown
Author

Ahhh, that's much nicer. Thanks so much!!!

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