I think this spec implies that I should commit myself into some kind of rehab.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
I think all you should care about is diffing an array (or string via join):
it "lists them in reverse chronological order" do
recent_titles_in_db = Article.for_dashboard.map(&:title)
recent_ttiles_on_page = page.all('#articles li').map(&:text)
recent_titles_in_db.should eq(recent_titles_on_page)
endAhhh, 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
... Yeah. Not totally happy, but it's the best thing I could think of.
I miss my mocks in request specs.