
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Able Technology &#187; rails</title>
	<atom:link href="http://www.abletech.co.nz/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abletech.co.nz</link>
	<description>Web Application Programmers and Consultants</description>
	<lastBuildDate>Sun, 11 Jul 2010 22:05:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>LibXML Segmentation fault</title>
		<link>http://www.abletech.co.nz/2010/06/libxml-ree-2010-01-segmentation-fault-tracked-down/</link>
		<comments>http://www.abletech.co.nz/2010/06/libxml-ree-2010-01-segmentation-fault-tracked-down/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 22:44:25 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=532</guid>
		<description><![CDATA[I have been getting intermittent segfaults with Ruby Enterprise Edition 2010.01 on both Mac OSX Snow Leopard 10.6, and Centos 5.3 with LibXML: /opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.3/lib/libxml/node.rb:57: [BUG] Segmentation fault ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01 See the LibXML Rubyforge page more details, but the solution is to code your document finders [...]]]></description>
			<content:encoded><![CDATA[<p>I have been getting <em>intermittent</em> segfaults with <a href="http://www.rubyenterpriseedition.com/">Ruby Enterprise Edition</a> 2010.01 on both Mac OSX Snow Leopard 10.6, and <a href="http://www.centos.org/">Centos</a> 5.3 with <a href="http://libxml.rubyforge.org/rdoc/index.html">LibXML</a>:</p>

<textarea name="code" class="ruby">
/opt/ruby-enterprise-1.8.7-2010.01/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.3/lib/libxml/node.rb:57: [BUG] Segmentation fault
ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01
</textarea>

<p>See the <a href="http://libxml.rubyforge.org/rdoc/index.html">LibXML Rubyforge</a> page more details, but the solution is to code your document finders as below...</p>

<textarea name="code" class="ruby">
results = document.find('/')
...
results = nil
GC.start
</textarea>]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2010/06/libxml-ree-2010-01-segmentation-fault-tracked-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RVM gotcha and ARCHFLAGS on snow leopard</title>
		<link>http://www.abletech.co.nz/2010/06/rvm-gotcha-and-archflags-on-snow-leopard/</link>
		<comments>http://www.abletech.co.nz/2010/06/rvm-gotcha-and-archflags-on-snow-leopard/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 22:40:27 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=534</guid>
		<description><![CDATA[After installing Ruby Enterprise Edition 2010.02 via RVM, I was getting seg faults in the native gems. The solution was easy: rvm remove ree-1.8.7-2010.02 rm -rf ~/.rvm/gems/ree-1.8.7-2010.02 export ARCHFLAGS="-arch x86_64" rvm install ree-1.8.7-2010.02 &#038;& rvm use ree-1.8.7-2010.02 bundle install I think i will be adding ARCHFLAGS="-arch x86_64" to my bash_login....]]></description>
			<content:encoded><![CDATA[<p>After installing <a href="http://www.rubyenterpriseedition.com/">Ruby Enterprise Edition</a> 2010.02 via <a href="http://rvm.beginrescueend.com/">RVM</a>, I was getting seg faults in the native gems. The solution was easy:</p>

<textarea name="code" class="ruby">
rvm remove ree-1.8.7-2010.02
rm -rf ~/.rvm/gems/ree-1.8.7-2010.02
export ARCHFLAGS="-arch x86_64"
rvm install ree-1.8.7-2010.02 && rvm use ree-1.8.7-2010.02
bundle install
</textarea>

<p>I think i will be adding ARCHFLAGS="-arch x86_64" to my bash_login....</p>]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2010/06/rvm-gotcha-and-archflags-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recurring billing of expired credit cards</title>
		<link>http://www.abletech.co.nz/2010/01/recurring-billing-of-expired-credit-cards/</link>
		<comments>http://www.abletech.co.nz/2010/01/recurring-billing-of-expired-credit-cards/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 02:11:03 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=485</guid>
		<description><![CDATA[At Sharesight [www.sharesight.co.nz] we operate an online, subscription based portfolio management for DIY share market investors. For convenience, most of our customers choose to pay by credit card, and we bill them on a recurring basis, either monthly or annually. When customers subscribe, we make it clear to them that we will bill their card [...]]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://www.sharesight.co.nz/">Sharesight</a> [www.sharesight.co.nz] we operate an online, subscription based portfolio management for DIY share market investors. For convenience, most of our customers choose to pay by credit card, and we bill them on a recurring basis, either monthly or annually. When customers subscribe, we make it clear to them that we will bill their card on a recurring basis (and, most importantly, we also make it easy for customers to cancel their subscription whenever they want).</p>
<p>We use the ActiveMerchant plugin (Ruby on Rails) to connect to the DPS Payment Express payment gateway. DPS connects to our BNZ Buyline merchant account which allows us to bill customers in both NZD and AUD. When we pass through a customer’s card details to DPS they return a billing token, and when we need to bill the card in the future, we simply send through the appropriate billing token to DPS along with the amount to be billed (this amount may change if customers upgrade or downgrade their accounts). This saves us from having to store our customers’ credit card details, and worry about the security issues that this entails.</p>
<h4>Expired Credit Cards</h4>
<p>Until now, the only real issue that we faced was the problem of expiring credit cards. Credit cards generally expire every two years (sometimes more frequently), primarily due to the fact that this is the life expectancy of the magnetic strip on the back of the card. When a customer’s credit card expired, they needed to provide us with the updated card details, otherwise when we tried to charge their card, we would receive a ‘card expired’ error back from DPS. Clearly this somewhat limits the convenience factor for our customers, in fact many customers told us so, pointing out that their card number hadn’t changed.</p>
<p>The solution, as it turns out, is a little known feature called the recurring billing flag. Essentially when a payment is sent through to the bank with the recurring billing flag set, they will (generally) ignore the expiry date when processing the transaction. I came across this feature via <a href="http://itmanagement.earthweb.com/columns/executive_tech/article.php/3607996/Credit-Card-Expiration-Dates-Are-Obsolete.htm">this blog post</a>, but could not find it documented anywhere in the technical documentation provided by either the bank or DPS. A quick call to a knowledgeable staff member at DPS, confirmed that they could in fact set this flag for us provided that we obtained written permission from the bank. Luckily we had no problem in obtaining prompt approval from the BNZ, and we were able to have the recurring billing flag enabled on our transactions within a couple of days.</p>
<p>I hope this knowledge is useful for other SaaS vendors who bill customers on a recurring basis. From what I understand, the banks may have different policies on allowing the recurring flag to be set.</p>
<p>Please let us know your experiences.</p>
<p><strong>Special guest post by <a href="http://www.sharesight.co.nz/about_us/#scott">Scott Ryburn</a>.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2010/01/recurring-billing-of-expired-credit-cards/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oauth presentation</title>
		<link>http://www.abletech.co.nz/2009/12/oauth-presentation/</link>
		<comments>http://www.abletech.co.nz/2009/12/oauth-presentation/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 08:25:08 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=477</guid>
		<description><![CDATA[He is a copy of my Oauth presentation [806 kB] from tonight's WellRailed group. I discussed Oauth from both a client and a server perspective. Plenty of examples from Sharesight, where we are building an API. Here is the example test.rb 'http://localhost:3000') @request_token = @consumer.get_request_token puts "Authorise url: #{@request_token.authorize_url}" `open #{@request_token.authorize_url}` puts "Enter OAuth verifier:" [...]]]></description>
			<content:encoded><![CDATA[<p>He is a copy of my <a href="/wp-content/uploads/2009/12/oauth.pdf">Oauth presentation</a> [806 kB] from tonight's <a href="http://groups.google.co.nz/group/WellRailed">WellRailed group</a>. I discussed Oauth from both a client and a server perspective. Plenty of examples from <a href="http://www.sharesight.co.nz">Sharesight</a>, where we are building an API. </p>

<p>Here is the example <code>test.rb</code file from the presentation:</p>

<textarea name="code" class="ruby" cols="90 rows="20">
#!/usr/bin/ruby
#

require 'rubygems'
require 'oauth'
require 'pp'

###################
# Authorisation
###################
@consumer = OAuth::Consumer.new("FDcyJ3ZrVlJhEuI4mOtC", "ytjnPDxT8QGi2f7YHlswJLoCWsQ3SGubmwVojJlx", :site => 'http://localhost:3000')
@request_token = @consumer.get_request_token

puts "Authorise url: #{@request_token.authorize_url}"
`open #{@request_token.authorize_url}`

puts "Enter OAuth verifier:"
@oauth_verifier = gets.strip

@access_token = @request_token.get_access_token(:oauth_verifier => @oauth_verifier)

###################
# Use
###################
@response = @access_token.get '/api/trades.xml'
pp @response.body
</textarea>

<p>I also discussed <a href="http://loadstorm.com">LoadStorm.com</a>, which has a free plan that allows up to 50 simultaneous users. I recommend you check them out. </p>]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2009/12/oauth-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Macbook Pro Speed Test</title>
		<link>http://www.abletech.co.nz/2009/09/macbook-pro-speed-test/</link>
		<comments>http://www.abletech.co.nz/2009/09/macbook-pro-speed-test/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 08:24:46 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=392</guid>
		<description><![CDATA[With the Sharesight test suite (ruby/rails/mysql &#038;&#038; rake test), i tested the performance of my the new MBP on Snow Leopard. I save 16 seconds per run &#8211; its going to take a while to pay for itself&#8230;. But about 22% faster, which is not too bad. Macbook Pro (March 06) 1.83GHz 2G Ram real [...]]]></description>
			<content:encoded><![CDATA[<p>With the <a href="http://www.sharesight.co.nz/">Sharesight</a> test suite (ruby/rails/mysql &#038;&#038; rake test), i tested the performance of my the new MBP on Snow Leopard. </p>
<p>I save 16 seconds per run &#8211; its going to take a while to pay for itself&#8230;.  But about 22% faster, which is not too bad.</p>
<p>Macbook Pro (March 06) 1.83GHz 2G Ram<br />
real    1m29.464s<br />
user    0m50.348s<br />
sys    0m5.812s</p>
<p>Macbook Pro (Sep 09) 2.53 GHz 4G Ram<br />
real 1m13.450s<br />
user 0m43.662s<br />
sys 0m3.280s</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2009/09/macbook-pro-speed-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>using git submodules for plugins</title>
		<link>http://www.abletech.co.nz/2009/07/using-git-submodules-for-plugins/</link>
		<comments>http://www.abletech.co.nz/2009/07/using-git-submodules-for-plugins/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 02:23:58 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[git rails]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=363</guid>
		<description><![CDATA[# first remove your copy and paste plugin&#8230;. git rm -r vendor/plugins/xxxxxx git commit now you are ready to add the submodule git submodule add git://your_git_repo/xxxxx.git vendor/plugins/xxxxx git commit To load the submodule, you need to git submodule init git submodule update To deploy submodules using capistrano, capistrano needs to also do the submodule init [...]]]></description>
			<content:encoded><![CDATA[<p># first remove your copy and paste plugin&#8230;.</p>
<pre>
git rm -r vendor/plugins/xxxxxx
git commit
</pre>
<p>now you are ready to add the submodule</p>
<pre>
git submodule add git://your_git_repo/xxxxx.git vendor/plugins/xxxxx
git commit
</pre>
<p>To load the submodule, you need to </p>
<pre>
git submodule init
git submodule update
</pre>
<p>To deploy submodules using capistrano, capistrano needs to also do the submodule init and update. </p>
<pre>
# in deploy.rb
set :git_enable_submodules,1
</pre>
<p>if you want to update the version of the submodule &#8211; or the branch<br />
cd into the plugin, git pull or git checkout branch<br />
then cd back to the containing project and git commit</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2009/07/using-git-submodules-for-plugins/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>serving php from a rails app with passenger</title>
		<link>http://www.abletech.co.nz/2009/06/serving-php-from-a-rails-app-with-passenger/</link>
		<comments>http://www.abletech.co.nz/2009/06/serving-php-from-a-rails-app-with-passenger/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 09:24:48 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=346</guid>
		<description><![CDATA[We have a situation where we want one domain which serves a rails app at root and also has a wordpress blog served within the main site. yours.com/ --> served by rails yours.com/blog --> served by php To configure this in apache, Options FollowSymLinks AllowOverride None Order allow,deny Allow from all ExpiresActive On ExpiresDefault &#8220;access [...]]]></description>
			<content:encoded><![CDATA[We have a situation where we want one domain which serves a rails app at root and also has a wordpress blog served within the main site.
<pre>
yours.com/  --> served by rails
yours.com/blog --> served by php
</pre>

To configure this in apache, 
<textarea name="code" class="ruby" cols="90 rows="20">  
<Directory /var/www/apps/railsapp/current/public>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
	  ExpiresActive On
	  ExpiresDefault &#8220;access plus 1 year&#8221;
  </Directory>
  Alias /blog /var/www/apps/blog
  <Location /blog>
    PassengerEnabled off
  </Location>
</textarea>

The key is the <a href="http://www.modrails.com/documentation/Users%20guide.html#_passengerenabled_lt_on_off_gt">PassengerEnabled</a> &#8211; else passenger will try and serve the php content. ]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2009/06/serving-php-from-a-rails-app-with-passenger/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing Ruby Enterprise Edition on Mac OSX</title>
		<link>http://www.abletech.co.nz/2009/06/ree-on-mac-osx/</link>
		<comments>http://www.abletech.co.nz/2009/06/ree-on-mac-osx/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 09:33:49 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=335</guid>
		<description><![CDATA[This is quite trivial and very easy. I wanted to use the same version of ruby on my mac as is running on our production servers (Ruby Enterprise Edition). Firstly, do a gem list and keep this information. You will need to reinstall all your gems once you have successfully installed REE. Download REE from [...]]]></description>
			<content:encoded><![CDATA[<p>This is quite trivial and very easy. I wanted to use the same version of ruby on my mac as is running on our production servers (Ruby Enterprise Edition).</p>
<p>Firstly, do a
<pre>gem list</pre>
<p> and keep this information. You will need to reinstall all your gems once you have successfully installed REE.</p>
<p>Download REE from <a href="http://www.rubyenterpriseedition.com/">http://www.rubyenterpriseedition.com/</a></p>
<pre>tar xvfz ruby-enterprise-X.X.X</pre>
<pre>sudo ./ruby-enterprise-X.X.X/installer</pre>
<p>I suggest changing the default location to just /opt/ruby-enterprise &#8211; as you are unlikely to need to roll back the symbolic links in your development environment.</p>
<p>Once it is installed, then you need to make sure that you use it for all your gems, ruby, rake tasks. To do this we will sym link in all the executables into /usr/bin</p>
<p>Find any previous versions of ruby</p>
<pre>whereis ruby</pre>
<p> and
<pre>which ruby</pre>
<p>Cleanup &#8211; backup and remove any old versions and the associated ruby, gems, rake, irb, cap, capify, erb so they are not on your path.</p>
<p>Then sym link from /usr/bin to  opt/ruby-enterprise/bin with all the executables that you may require&#8230;.</p>
<pre>
sudo ln -s -f /opt/ruby-enterprise/bin/ruby /usr/bin/ruby
sudo ln -s -f /opt/ruby-enterprise/bin/cap    /usr/bin/cap
sudo ln -s -f /opt/ruby-enterprise/bin/capify /usr/bin/capify
sudo ln -s -f /opt/ruby-enterprise/bin/erb    /usr/bin/erb
sudo ln -s -f /opt/ruby-enterprise/bin/gem    /usr/bin/gem
sudo ln -s -f /opt/ruby-enterprise/bin/irb    /usr/bin/irb
sudo ln -s -f /opt/ruby-enterprise/bin/rails  /usr/bin/rails
sudo ln -s -f /opt/ruby-enterprise/bin/rake   /usr/bin/rake
sudo ln -s -f /opt/ruby-enterprise/bin/rdoc   /usr/bin/rdoc
</pre>
<p>Do a gem list to see what ruby-enterprise came bundled with.</p>
<p>Now you will need to install all your gems again &#8211; that you noted earlier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2009/06/ree-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rails legacy database migration</title>
		<link>http://www.abletech.co.nz/2009/06/rails-legacy-database-migration/</link>
		<comments>http://www.abletech.co.nz/2009/06/rails-legacy-database-migration/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 02:47:57 +0000</pubDate>
		<dc:creator>marcus</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=323</guid>
		<description><![CDATA[Just migrated a legacy database into a rails compliant database &#8211; and wrote this nifty DSL script to help out&#8230;. The rake task generates the Hash data for the table creation, data insert and rollback scripts. Once you run the rake task, paste the output into the migration modify the update table and column names [...]]]></description>
			<content:encoded><![CDATA[<p>Just migrated a legacy database into a rails compliant database &#8211; and wrote this nifty DSL script to help out&#8230;.</p>
<p>The rake task generates the Hash data for the table creation, data insert and rollback scripts.</p>
<p>Once you run the rake task, paste the output into the migration modify the update table and column names &#8211; then run the migration. </p>
<p><script src="http://gist.github.com/123394.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2009/06/rails-legacy-database-migration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>False-positive validation warnings</title>
		<link>http://www.abletech.co.nz/2009/03/false-positive-validation-warnings/</link>
		<comments>http://www.abletech.co.nz/2009/03/false-positive-validation-warnings/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 00:48:21 +0000</pubDate>
		<dc:creator>nigel</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.abletech.co.nz/?p=197</guid>
		<description><![CDATA[I had been getting some validation warnings when running some of my specs. The W3 validator confirmed that my xHTML was valid. ignoring attempt to close div with input opened at byte 6028, line 108 closed at byte 6131, line 109 attributes at open: {"class"=>"form_field"} text around open: "r\">\n \n\n scenarios(:abletech_pre_clicked_links).id response.headers['Content-Type'] = :xml end [...]]]></description>
			<content:encoded><![CDATA[<p>I had been getting some validation warnings when running some of my specs. The W3 validator confirmed that my xHTML was valid.</p>

<textarea name="code" class="ruby">
ignoring attempt to close div with input
  opened at byte 6028, line 108
  closed at byte 6131, line 109
  attributes at open: {"class"=>"form_field"}
  text around open: "r\"></div></div>\n    <div class=\"form_fie"
  text around close: "mit\" value=\"Log in\"></input>\n</div>\n</di"
</textarea>

<p>After some googling of the problem, it turns out there is a difference between how xhtml and html documents are handled. Essentially, you need to tell the parser that the document is xHTML rather than HTML. More details <a href="http://marklunds.com/articles/one/336">here</a>, <a href="http://weblog.jamisbuck.org/2007/1/4/assert_xml_select">here</a>, and <a href="http://dev.rubyonrails.org/ticket/1937">here</a>.</p>

<p>The solution is to tell RSpec that the document is XML based. The options given in the links above work for RUnit based tests. Taking a look at the rspec source, it is checking to see if the response is XML based by noting the Content-Type header record. So, here's the solution I used:</p>

<textarea name="code" class="ruby">
before(:each) do
  get :new, :id => scenarios(:abletech_pre_clicked_links).id
  response.headers['Content-Type'] = :xml
end
</textarea>

<p>Now, when I run my specs, it correctly parses the response as XHTML and passes validation without any warnings.</p>

<textarea name="code" class="ruby">
it 'should show two forms' do
  response.should have_tag('div.form_step', 2)
end
</textarea>

]]></content:encoded>
			<wfw:commentRss>http://www.abletech.co.nz/2009/03/false-positive-validation-warnings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
