Skip to content

Instantly share code, notes, and snippets.

@joshuaclayton
Created November 27, 2012 19:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joshuaclayton/4156575 to your computer and use it in GitHub Desktop.
Save joshuaclayton/4156575 to your computer and use it in GitHub Desktop.
describe 'Page without plans' do
it 'passes unless a second assertion is made that .plans li contains at least one element' do
visit root_path
all('.plans li').each do |node|
expect(node.text).to match /\$\d{1,2}/
end
end
end
@joshuaclayton
Copy link
Author

There are times when an expectation may not get run - it may be called when iterating over items or something even crazier. Is there a way for this to fail if no expectation is called without changing the body of the it block?

@dchelimsky
Copy link

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