<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  <title>Bryan Helmkamp - Webrat 0.1.0 released Comments</title>
  <id>tag:www.brynary.com,2008:/2007/12/8/webrat-0-1-0-released/comments</id>
  <generator version="0.8.0" uri="http://mephistoblog.com">Mephisto Drax</generator>
  <link href="http://www.brynary.com/2007/12/8/webrat-0-1-0-released/comments.xml" rel="self" type="application/atom+xml"/>
  <link href="/2007/12/8/webrat-0-1-0-released" rel="alternate" type="text/html"/>
  <updated>2008-03-02T20:08:17Z</updated>
  <entry xml:base="http://www.brynary.com/">
    <author>
      <name>Marcus Ahnve</name>
    </author>
    <id>tag:www.brynary.com,2007-12-08:906:993</id>
    <published>2008-02-26T22:24:04Z</published>
    <updated>2008-02-26T22:24:04Z</updated>
    <category term="BDD"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <link href="http://www.brynary.com/2007/12/8/webrat-0-1-0-released" rel="alternate" type="text/html"/>
    <title>Comment on 'Webrat 0.1.0 released' by Marcus Ahnve</title>
<content type="html">&lt;p&gt;I would like to use webrat with merb &#8211; any plans on releasing webrat as a gem?&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://www.brynary.com/">
    <author>
      <name>Matt Van Horn</name>
    </author>
    <id>tag:www.brynary.com,2007-12-08:906:954</id>
    <published>2008-02-05T22:14:21Z</published>
    <updated>2008-02-05T22:14:21Z</updated>
    <category term="BDD"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <link href="http://www.brynary.com/2007/12/8/webrat-0-1-0-released" rel="alternate" type="text/html"/>
    <title>Comment on 'Webrat 0.1.0 released' by Matt Van Horn</title>
<content type="html">&lt;p&gt;I just started using this today, and it is pretty neat. It seemed to be missing anyhting for radio buttons, so I patched my install with this (in sessions.rb)&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;def selects_radio_button(field, options = {})
  value = options[:choice]
end&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;radios = find_field_by_name_or_label(field)
return flunk(&quot;Could not find radio button #{field.inspect}&quot;) if radios.nil?
radios = [radios].flatten
if radios.size &amp;gt; 1
  radios = radios.select{|r| r.attributes[&quot;type&quot;]  &quot;radio&quot; &#38;&#38; (r.attributes[&quot;value&quot;]  value || r.attributes[&quot;value&quot;].blank?)}
  return flunk(&quot;Could not find valid radio button #{field.inspect}&quot;) if radios.empty?
end
radio = radios.first
return flunk(&quot;#{field.inspect} is not a valid radio button&quot;) unless radio.attributes[&quot;type&quot;]==&quot;radio&quot; 
add_form_data(radio, radio.attributes[&quot;value&quot;] || &quot;on&quot;)&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;and I put this in webrat steps:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;When &quot;selects choice '$choice' for $radio&quot; do |choice, radio|
  selects_radio_button radio, :with =&amp;gt; choice
end&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;It&#8217;s ugly and not tested very well but it&#8217;s a start.&lt;/p&gt;</content>  </entry>
  <entry xml:base="http://www.brynary.com/">
    <author>
      <name>Austin Putman</name>
    </author>
    <id>tag:www.brynary.com,2007-12-08:906:953</id>
    <published>2008-02-02T08:03:36Z</published>
    <updated>2008-02-02T08:03:36Z</updated>
    <category term="BDD"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <link href="http://www.brynary.com/2007/12/8/webrat-0-1-0-released" rel="alternate" type="text/html"/>
    <title>Comment on 'Webrat 0.1.0 released' by Austin Putman</title>
<content type="html">&lt;p&gt;Hey, I&#8217;m working on a post covering the state of view testing and would love to include something about webrat.  Working from your &lt;span class=&quot;caps&quot;&gt;README&lt;/span&gt; it is not clear how to integrate this library into my spec suite.&lt;/p&gt;


is it appropriate to make a new webrat session like so:
&lt;code&gt;
     @webrat = ActionController::Integration::Session.new  
&lt;/code&gt;

	&lt;p&gt;and then run examples like this?&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;it &quot;can log in&quot; do
  @webrat.visits &quot;/login&quot; 
  @webrat.fills_in &quot;login&quot;, :with =&amp;gt; &quot;user&quot; 
  @webrat.fills_in &quot;password&quot;, :with =&amp;gt; &quot;l00ser&quot; 
  @webrat.clicks_button &quot;Log in&quot; 
  @webrat.response.body.should match(/Users/)
end&lt;/code&gt;&lt;/pre&gt;</content>  </entry>
  <entry xml:base="http://www.brynary.com/">
    <author>
      <name>Tim Connor</name>
    </author>
    <id>tag:www.brynary.com,2007-12-08:906:925</id>
    <published>2007-12-19T01:06:13Z</published>
    <updated>2007-12-19T01:06:13Z</updated>
    <category term="BDD"/>
    <category term="Rails"/>
    <category term="Ruby"/>
    <link href="http://www.brynary.com/2007/12/8/webrat-0-1-0-released" rel="alternate" type="text/html"/>
    <title>Comment on 'Webrat 0.1.0 released' by Tim Connor</title>
<content type="html">&lt;p&gt;Awesome, Bryan.  I need to add a acceptance/full-stack-integration test, but don&#8217;t want the hassle of having to run watir/selenium.  I was considering throwing something together with mechanize/hpricot, but now I don&#8217;t need to (and this is more full-featured than I&#8217;d do for a one-off). :D&lt;/p&gt;</content>  </entry>
</feed>
