Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

assert_select checking for negatives

#963

Hey all,

I found myself testing for a checkbox that isn't checked today. It would be nice if assert_select accepted something like: assert_select "[!checked]"

Reported by Bart Zonneveld · September 3rd, 2008 @ 03:01 PM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Nobuhiro IMAI
    Nobuhiro IMAI

    How about the following workaround?

    
    assert_raise(Test::Unit::AssertionFailedError) do
      assert_select "[checked=checked]"
    end
    

    Firebug seems to recognize [checked!=checked]. HTH.

    September 14th, 2008 @ 09:05 AM

  2. Pratik
    Pratik
    • State changed from new to invalid

    December 19th, 2008 @ 03:07 PM