<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Blog do Tino Gomes &#187; ajax</title>
	<atom:link href="http://blog.tinogomes.com/tag/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tinogomes.com</link>
	<description>Nenhum de nós é tão bom quanto TODOS nós juntos!</description>
	<lastBuildDate>Fri, 03 Feb 2012 21:34:18 +0000</lastBuildDate>
	<language>pt-br</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.tinogomes.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/67a2349adf8ea6e4963082bfa1424d44?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Blog do Tino Gomes &#187; ajax</title>
		<link>http://blog.tinogomes.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.tinogomes.com/osd.xml" title="Blog do Tino Gomes" />
	<atom:link rel='hub' href='http://blog.tinogomes.com/?pushpress=hub'/>
		<item>
		<title>Testando respostas em RJS</title>
		<link>http://blog.tinogomes.com/2008/01/04/testando-respostas-em-rjs/</link>
		<comments>http://blog.tinogomes.com/2008/01/04/testando-respostas-em-rjs/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 20:27:32 +0000</pubDate>
		<dc:creator>Celestino Gomes</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rjs]]></category>
		<category><![CDATA[teste]]></category>

		<guid isPermaLink="false">http://tinogomes.wordpress.com/2008/01/04/testando-respostas-em-rjs/</guid>
		<description><![CDATA[Como testar o render desta acao? ... def minha_acao novo_valor = params[:novo_valor] render :update do &#124;page&#124; page.replace_html "div_valor_total", novo_valor end end Simples: def test_minha_acao get :minha_acao, :novo_valor =&#62; '100.00' assert_match Regexp.new("Element.update('div_valor_total', '100.00');"), @response.body end Mas achei um plugin muito legal que ajuda a fazer esses tipos de festa. Vos apresento o ARTS &#8211; Another RJS [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.tinogomes.com&amp;blog=2362964&amp;post=13&amp;subd=tinogomes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Como testar o render desta acao?</p>
<p><code>...<br />
def minha_acao<br />
novo_valor = params[:novo_valor]<br />
render :update do |page|<br />
page.replace_html "div_valor_total", novo_valor<br />
end<br />
end<br />
</code><br />
<span id="more-13"></span><br />
Simples:</p>
<p><code>def test_minha_acao<br />
get :minha_acao, :novo_valor =&gt; '100.00'<br />
assert_match Regexp.new("Element.update('div_valor_total', '100.00');"), @response.body<br />
end</code></p>
<p>Mas achei um plugin muito legal que ajuda a fazer esses tipos de festa. Vos apresento o <a href="http://glu.ttono.us/articles/2006/05/29/guide-test-driven-rjs-with-arts" target="_blank">ARTS &#8211; Another RJS Testing System</a> de <a href="http://glu.ttono.us/" target="_blank">Kevin Clark</a>.</p>
<p>Veja como ficaria o código do teste:</p>
<p><code>def test_minha_acao<br />
get :minha_acao<br />
assert_rjs :replace_html, :div_valor_total, '100.00'<br />
end</code></p>
<p>Na minha opinião, bem melhor! :)</p>
<p>Para instalar o plugin:</p>
<ol>
<li>Ir até a raiz da pasta do projeto</li>
<li>Executar: <code>script/plugin discover</code></li>
<li>Executar: <code>script/plugin install arts</code></li>
</ol>
<p>Maiores detalhes está no <a href="http://glu.ttono.us/articles/2006/05/29/guide-test-driven-rjs-with-arts" target="_blank">guia</a> no próprio blog do Kevin!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/tinogomes.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/tinogomes.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tinogomes.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tinogomes.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tinogomes.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tinogomes.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tinogomes.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tinogomes.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tinogomes.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tinogomes.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tinogomes.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tinogomes.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tinogomes.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tinogomes.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tinogomes.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tinogomes.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.tinogomes.com&amp;blog=2362964&amp;post=13&amp;subd=tinogomes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.tinogomes.com/2008/01/04/testando-respostas-em-rjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9742692d8f4eb9997301de35395e5460?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">Tino</media:title>
		</media:content>
	</item>
	</channel>
</rss>
