On 16 Apr 2009, at 14:06, Joaquin Rivera Padron wrote:
thanks matt,
yes, the regexp in the step matcher is a good one to dry it up
So I end up with this one:
Then /^I (should|should not) see the people search form$/ do |maybe|
people_search_form_should_exist maybe == "should"
end
and the method:
def people_search_form_should_exist it_should_exist
_not = "_not" unless it_should_exist
response.send "should#{_not}".to_sym, have_tag('form#frmSearch')
end
only because I find it easier to read (when I don't need to jump to
the method), but yours maybe faster (shorter it is), I could come
back to it later and benchmark both
If you don't mind using the #send (I was trying to help you get rid of
it) then just do this:
Then /^I (should|should not) see the people search form$/ do |maybe|
response.send maybe.underscore.to_sym, have_tag('form#frmSearch')
end
thanks again,
joaquin
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users