Have_selector only matching immediate descendants in block

Hi – I have an expectation that looks like this:

it “should display a field for the username” do
response.should have_selector( “form” ) do |form|
form.should have_selector( “input”, :name => “username” )

That gives me this error:

‘session/new.html.haml should display a field for the username’ FAILED
expected following output to contain a tag:



When I don’t try to match inside the form (so just saying
have_selector( “input” … )”), it passes fine.
So is have_selector supposed to only match immediate descendants of the
selector in the block definition, or is this a bug …
… Or am I being seriously dumb, here? :wink:
Cheers, Doug.

On Wed, May 6, 2009 at 7:14 AM, doug livesey [email protected] wrote:

That gives me this error:

… Or am I being seriously dumb, here? :wink:
have_selector is from webrat and there is a separate webrat google
group. Might want to try there, or filing a bug report with webrat:



Will do – cheers!

2009/5/6 David C. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs