[rspec-users] how can I do an "or" within the context of a matcher?
Rodrigo Rosenfeld Rosas
lbocseg at yahoo.com.br
Tue May 15 14:18:05 UTC 2012
You're looking for Custom Matchers:
Em 15-05-2012 03:47, Patrick J. Collins escreveu:
> Capybara has two methods:
> ... I am wondering, how can I make a helper method that will be
> satisfied by one or the other? In other words, I want to be able to do:
> page.should have_link_or_button("blah")
> def have_link_or_button(locator)
> have_link(locator) || have_button(locator)
> But that doesn't work... Is there any way to do this?
> Patrick J. Collins
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users