# \[ANN\] Webrat 0.1.0 released - Ruby Acceptance Testing for Web applications

**URL:** <https://www.ruby-forum.com/t/ann-webrat-0-1-0-released-ruby-acceptance-testing-for-web-applications/121704>\
**Category:** Rails\
**Created:** [November 30, 2007, 3:25am UTC](https://www.ruby-forum.com/t/ann-webrat-0-1-0-released-ruby-acceptance-testing-for-web-applications/121704 "2007-11-30T03:25:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bryan123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9e8a1a/32.png) [@bryan123](https://www.ruby-forum.com/u/bryan123)\
**Post date:** [November 30, 2007, 3:25am UTC](https://www.ruby-forum.com/t/ann-webrat-0-1-0-released-ruby-acceptance-testing-for-web-applications/121704/1 "2007-11-30T03:25:38Z")

</div>

Webrat - Ruby Acceptance Testing for Web applications - version 0.1.0  
released!

[http://svn.eastmedia.net/public/plugins/webrat/](http://svn.eastmedia.net/public/plugins/webrat/)

Webrat lets you quickly write robust and thorough acceptance tests for  
a Ruby  
web application. By leveraging the DOM, it can run tests similarly to  
an  
in-browser testing solution without the associated performance hit  
(and  
browser dependency). The result is tests that are less fragile and  
more  
effective at verifying that the app will respond properly to users.

Webrat works with vanilla Rails integration tests run via Test::Unit  
and scenarios  
run by the RSpec story runner.

== SYNOPSIS:

def test\_sign\_up  
visits “/”  
clicks\_link “Sign up”  
fills\_in “Email”, :with =\> “removed\_email\_address@domain.invalid”  
select “Free account”  
clicks\_button “Register”  
…  
end

Behind the scenes, this will perform the following work:

1. Verify that loading the home page is successful
2. Verify that a “Sign up” link exists on the home page
3. Verify that loading the URL pointed to by the “Sign up” link leads  
to a  
successful page
4. Verify that there is an “Email” input field on the Sign Up page
5. Verify that there is an select field on the Sign Up page with an  
option for  
“Free account”
6. Verify that there is a “Register” submit button on the page
7. Verify that submitting the Sign Up form with the values  
“removed\_email\_address@domain.invalid”  
and “Free account” leads to a successful page

Take special note of the things _not_ specified in that test, that  
might cause  
tests to break unnecessarily as your application evolves:

- The input field IDs or names (e.g. “user\_email” or “user[email]”),  
which  
could change if you rename a model
- The ID of the form element (Webrat can do a good job of guessing,  
even if  
there are multiple forms on the page.)
- The URLs of links followed
- The URL the form submission should be sent to, which could change if  
you  
adjust your routes or controllers
- The HTTP method for the login request

A test written with Webrat can handle all of these changes smoothly.

== INSTALL:

$ ruby script/plugin install  
[http://svn.eastmedia.net/public/plugins/webrat/](http://svn.eastmedia.net/public/plugins/webrat/)

---

<div class="post-metadata">

**Author:** ![bryan123](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9e8a1a/32.png) [@bryan123](https://www.ruby-forum.com/u/bryan123)\
**Post date:** [November 30, 2007, 5:47am UTC](https://www.ruby-forum.com/t/ann-webrat-0-1-0-released-ruby-acceptance-testing-for-web-applications/121704/2 "2007-11-30T05:47:44Z")

</div>

This looks awesome.

Hopefully this will help reduce the number of times I want to punch  
\*Watir in the face.

–Jeremy

On Nov 29, 2007 9:25 PM, Bryan H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> in-browser testing solution without the associated performance hit
> 
> 1. Verify that submitting the Sign Up form with the values
> 
> - The ID of the form element (Webrat can do a good job of guessing,  
> == INSTALL:
> 
> $ ruby script/plugin install [http://svn.eastmedia.net/public/plugins/webrat/](http://svn.eastmedia.net/public/plugins/webrat/)
> 
> >

–  
[http://www.jeremymcanally.com/](http://www.jeremymcanally.com/)

My books:  
Ruby in Practice

> **[Ruby in Practice](https://www.manning.com/books/ruby-in-practice)**
>
> Like Ruby itself, Ruby in Practice will make you more productive. The book shows you practical techniques and strategies for small projects and large-scale environments. A cookbook-style reference, it gives you concrete examples of systems...

My free Ruby e-book

> **[Site not found · DreamHost](http://www.humblelittlerubybook.com/)**
>
> The owner of this domain has not yet uploaded their website.

My blogs:

> **[Site not found · DreamHost](http://www.mrneighborly.com/)**
>
> The owner of this domain has not yet uploaded their website.

[http://www.rubyinpractice.com/](http://www.rubyinpractice.com/)
