#170 ✓invalid
Matt Blodgett

have_selector() doesn't work with block

Reported by Matt Blodgett | February 18th, 2009 @ 04:48 PM

Let's say my view contains a snippet like this:

<div class="first_name"> Matt </div>

And my step contains something like this:

response.should have_selector(".first_name") do |scope| puts "=== this code never runs ===" end

The code inside the block is never executed.

Comments and changes to this ticket

  • Peter Jaros

    Peter Jaros March 23rd, 2009 @ 04:22 PM

    This should be fixed in 0.4.3. Matt, can you confirm?

  • gaffo

    gaffo May 7th, 2009 @ 06:21 PM

    • State changed from “new” to “open”
  • Francisco Viramontes

    Francisco Viramontes May 16th, 2009 @ 08:10 PM

    I have a similar problem

    with this

    @@@ruby Then /^I should see a list of the jobs filtered by the search query "([^"]*)"$/ do |arg1|
    response.should have_selector("tr.job_row") do |tr|

    tr.should contain(/#{arg1}/)

    end end

    I get this error

    expected following output to contain a <tr.job_row/> tag:

    css selector is not working or something becaus it wants to find a tag not a class
  • gaffo

    gaffo June 10th, 2009 @ 03:41 PM

    Throwing in a pending spec would be a great first step to getting this done.


  • gaffo

    gaffo June 10th, 2009 @ 07:27 PM

    Assert that your block gets called in the test, or does that other test already do so? For example:

     pass = false
     Have_selector do

    End Assert(pass)

    -- Sent from my Palm Pre Lighthouse wrote:

  • gaffo

    gaffo June 10th, 2009 @ 08:14 PM

    • State changed from “open” to “invalid”

    Cool, thanks for being responsive and submitting. [#170 state:invalid]

    -- Sent from my Palm Pre Lighthouse wrote:

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

People watching this ticket

Referenced by