The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
assert_select for Watir

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Dave Hoover

Posts: 93
Nickname: dsrhoov53
Registered: Mar, 2004

Dave Hoover is the Lead Consultant for Obtiva
assert_select for Watir Posted: Jan 8, 2007 9:09 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Dave Hoover.
Original Post: assert_select for Watir
Feed Title: Red Squirrel Reflections
Feed URL: http://redsquirrel.com/cgi-bin/dave/index.rss
Feed Description: Dave Hoover explores the psychology of software development
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Dave Hoover
Latest Posts From Red Squirrel Reflections

Advertisement
Inspired 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.

Read: assert_select for Watir

Topic: Adhearsion - A new Ruby toolkit for developing Voice/VoIP applications. Previous Topic   Next Topic Topic: Typo errors on postponed articles

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use