<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Bulk testing your model attributes with rails</title>
	<atom:link href="http://www.webdevbros.net/2007/12/12/bulk-testing-of-your-model-attributes-with-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdevbros.net/2007/12/12/bulk-testing-of-your-model-attributes-with-rails/</link>
	<description>hot talk about web development</description>
	<lastBuildDate>Tue, 10 May 2011 13:11:20 +0200</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Michael Rigart</title>
		<link>http://www.webdevbros.net/2007/12/12/bulk-testing-of-your-model-attributes-with-rails/#comment-9680</link>
		<dc:creator>Michael Rigart</dc:creator>
		<pubDate>Fri, 13 Mar 2009 19:00:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.webdevbros.net/2007/12/12/bulk-testing-of-your-model-attributes-with-rails/#comment-9680</guid>
		<description>hi, nice post. I&#039;ve implemented your work to learn more about TTD.

But I seem to have stumbled upon a problem.  When I want to test for an attribute witch should be a boolean, I can&#039;t seem to get my test to pass:
[ruby]
  def test_is_root
    bulk_attr_test(
      @client,
      :is_root,
      :valid =&gt; [0, 1, true, false],
      :invalid =&gt; [nil, &#039;&#039;, &#039; &#039;, &#039;this is not valid&#039; ,-1, 1.30 ,2, 10]
    )
  end
[/ruby]
My model validation looks like this:
[ruby]
  validates_inclusion_of :is_root, :in =&gt; [false, true],  :message =&gt; &quot;{{value}} is not a valid boolean value&quot;
[/ruby]

Do you have any idea what the problem could be?</description>
		<content:encoded><![CDATA[<p>hi, nice post. I've implemented your work to learn more about TTD.</p>
<p>But I seem to have stumbled upon a problem.  When I want to test for an attribute witch should be a boolean, I can't seem to get my test to pass:</p>
<div class="igBar"><span id="lruby-1"><a href="#" onclick="javascript:showCodeTxt('ruby-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-1">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#9966CC; font-weight:bold;">def</span> test_is_root</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; bulk_attr_test<span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; @client,</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; :is_root,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; :valid =&amp;gt; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;color:#800000;">0</span>, <span style="color:#006666;color:#800000;">1</span>, <span style="color:#0000FF; font-weight:bold;">true</span>, <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#93;</span>,</div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; :invalid =&amp;gt; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF; font-weight:bold;">nil</span>, '', ' ', 'this is <span style="color:#9966CC; font-weight:bold;">not</span> valid' ,-<span style="color:#006666;color:#800000;">1</span>, <span style="color:#006666;color:#800000;">1</span>.<span style="color:#006666;color:#800000;">30</span> ,<span style="color:#006666;color:#800000;">2</span>, <span style="color:#006666;color:#800000;">10</span><span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#9966CC; font-weight:bold;">end</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
My model validation looks like this:</p>
<div class="igBar"><span id="lruby-2"><a href="#" onclick="javascript:showCodeTxt('ruby-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">RUBY:</span>
<div id="ruby-2">
<div class="ruby">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#767676;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">validates_inclusion_of :is_root, :<span style="color:#9966CC; font-weight:bold;">in</span> =&amp;gt; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#0000FF; font-weight:bold;">false</span>, <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#93;</span>,&nbsp; :message =&amp;gt; <span style="color:#996600;">"{{value}} is not a valid boolean value"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Do you have any idea what the problem could be?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

