Forum: RSpec failing feature step when have_selector uses block

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Doug L. (Guest)
on 2009-05-20 13:49
(Received via mailing list)
Hi -- I have a strange bug.
The following step will pass:

Then /^I should not see any options for the properties$/ do
  response.should have_selector( "table thead" )
end

But this will fail:

Then /^I should not see any options for the properties$/ do
  response.should have_selector( "table thead" ) do |thead|
    thead.should_not contain( "Options" )
  end
end

The strange thing is that it isn't the inner specification that fails,
but
the outer one that is (or should be) identical to the first example
(which
is just a reduced version of the second to investigate what was
failing).
This is the second weird thing I have seen with nested blocks in
have_selector (the first was nested calls to have_selector only checking
immediate descendants of the block parameter). Is there something about
their use that I'm not understanding?
Cheers,
   Doug.
Zach D. (Guest)
on 2009-05-21 01:11
(Received via mailing list)
On Wed, May 20, 2009 at 5:30 AM, doug livesey 
<removed_email_address@domain.invalid> wrote:
>   response.should have_selector( "table thead" ) do |thead|
> their use that I'm not understanding?
Are you using selenium or just with webrat?

> http://groups.google.com/group/webrat?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
>



--
Zach D.
http://www.continuousthinking.com (personal)
http://www.mutuallyhuman.com (hire me)
http://ideafoundry.info/behavior-driven-development (first rate BDD
training)
@zachdennis (twitter)
This topic is locked and can not be replied to.