|
Red Squirrel Reflections
Dave Hoover explores the psychology of software development
|
|
Wed, 03 Jan 2007Inspired by Jamis' post on assert_select I've just committed an update to my Watir on Rails plugin that adds support for both assert_select and assert_tag. Give it a try!
require File.dirname(__FILE__) + '/../test_helper'
class GettingStartedTest < Test::Unit::TestCase
include WatirOnRails
def test_getting_started
browser = open_browser("/")
assert_select "div#getting-started h1", "Getting started"
assert_tag :tag => "h1", :content => "Getting started",
:parent => { :tag => "div", :attributes => { :id => "getting-started"} }
end
end
Rather than asserting against the body of the response from the controller, I'm grabbing the HTML from the most recently opened browser.
[/projects/watir] permanent link Reviving the Lightweight Visual Thesaurus I've brought my Lightweight Visual Thesaurus back to life. I'm hoping to make some improvements to it this year, like supporting more browsers than just Firefox. |