<?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: Testing RJS with assert_select_rjs</title>
	<atom:link href="http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/</link>
	<description>Start-ups, Maps and Local Search in New Zealand</description>
	<pubDate>Thu, 08 Jan 2009 12:55:38 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tim Haines</title>
		<link>http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/comment-page-1/#comment-1324</link>
		<dc:creator>Tim Haines</dc:creator>
		<pubDate>Fri, 29 Aug 2008 00:09:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/#comment-1324</guid>
		<description>Thanks for this post Thong.  Currently another cause of the "“No RJS statement that replaces or inserts HTML content” message is if your show or hide assertions don't match what's being returned.  Just logged a bug for this as it seems a very poor error message -&#62; http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/931

I found I didn't need format.js for the assertions to work.  Do you think format.js should be included anyway to ensure the header is set correctly?</description>
		<content:encoded><![CDATA[<p>Thanks for this post Thong.  Currently another cause of the &#8220;“No RJS statement that replaces or inserts HTML content” message is if your show or hide assertions don&#8217;t match what&#8217;s being returned.  Just logged a bug for this as it seems a very poor error message -&gt; <a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/931" rel="nofollow">http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/931</a></p>
<p>I found I didn&#8217;t need format.js for the assertions to work.  Do you think format.js should be included anyway to ensure the header is set correctly?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thong Kuah</title>
		<link>http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/comment-page-1/#comment-1261</link>
		<dc:creator>Thong Kuah</dc:creator>
		<pubDate>Tue, 27 May 2008 23:32:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/#comment-1261</guid>
		<description>Declan,

I had the rails syntax confused with the ARTS plugin. in rails, you would do 

assert_select_rjs :replace_html, "membership-action" do
  assert_select 'span', :text =&gt; 'Some content'
end

You would have to wrap the content in a html element, like a span. I am not sure if assert_select can find text nodes</description>
		<content:encoded><![CDATA[<p>Declan,</p>
<p>I had the rails syntax confused with the ARTS plugin. in rails, you would do </p>
<p>assert_select_rjs :replace_html, &#8220;membership-action&#8221; do<br />
  assert_select &#8217;span&#8217;, :text => &#8216;Some content&#8217;<br />
end</p>
<p>You would have to wrap the content in a html element, like a span. I am not sure if assert_select can find text nodes</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Declan</title>
		<link>http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/comment-page-1/#comment-1259</link>
		<dc:creator>Declan</dc:creator>
		<pubDate>Tue, 27 May 2008 13:40:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/#comment-1259</guid>
		<description>I have been trying to use...

assert_select_rjs :replace_html, “membership-action”, “Some Content”

... but it's not working. For example,

assert_select_rjs :replace_html, “happy_div”, “blah”

... will always pass regardless of whether the html content matches or not.</description>
		<content:encoded><![CDATA[<p>I have been trying to use&#8230;</p>
<p>assert_select_rjs :replace_html, “membership-action”, “Some Content”</p>
<p>&#8230; but it&#8217;s not working. For example,</p>
<p>assert_select_rjs :replace_html, “happy_div”, “blah”</p>
<p>&#8230; will always pass regardless of whether the html content matches or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thong Kuah</title>
		<link>http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/comment-page-1/#comment-912</link>
		<dc:creator>Thong Kuah</dc:creator>
		<pubDate>Sun, 26 Aug 2007 10:37:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/#comment-912</guid>
		<description>Thanks for the improvement. It would make the code more elegant. Note though that assert_difference is for rails edge (i.e &gt; 1.2.3)</description>
		<content:encoded><![CDATA[<p>Thanks for the improvement. It would make the code more elegant. Note though that assert_difference is for rails edge (i.e > 1.2.3)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Jones</title>
		<link>http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/comment-page-1/#comment-908</link>
		<dc:creator>David Jones</dc:creator>
		<pubDate>Fri, 24 Aug 2007 23:03:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/#comment-908</guid>
		<description>Ops, the before code is like this (not like the one above):

&lt;code&gt;
old_count = Membership.count  
delete :destroy, :id =&#62; 1  
assert_equal old_count-1, Membership.count
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Ops, the before code is like this (not like the one above):</p>
<p><code><br />
old_count = Membership.count<br />
delete :destroy, :id =&gt; 1<br />
assert_equal old_count-1, Membership.count<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Jones</title>
		<link>http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/comment-page-1/#comment-907</link>
		<dc:creator>David Jones</dc:creator>
		<pubDate>Fri, 24 Aug 2007 22:59:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.projectxtech.com/2007/08/23/testing-rjs-with-assert_select_rjs/#comment-907</guid>
		<description>You should be able to clean the membership_controller_test up by using asset_difference().

This is a fairly new method. Changeset here: http://dev.rubyonrails.org/browser/trunk/activesupport/lib/active_support/core_ext/test/difference.rb?rev=6647

Instead of
&lt;code&gt;
old_count = Membership.count  
assert_equal old_count-1,
Membership.count  
&lt;/code&gt;

You can do something more elegant, like this:

&lt;code&gt;
    assert_difference 'Membership.count' do
      delete :destroy, :id =&#62; 1  
    end
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>You should be able to clean the membership_controller_test up by using asset_difference().</p>
<p>This is a fairly new method. Changeset here: <a href="http://dev.rubyonrails.org/browser/trunk/activesupport/lib/active_support/core_ext/test/difference.rb?rev=6647" rel="nofollow">http://dev.rubyonrails.org/browser/trunk/activesupport/lib/active_support/core_ext/test/difference.rb?rev=6647</a></p>
<p>Instead of<br />
<code><br />
old_count = Membership.count<br />
assert_equal old_count-1,<br />
Membership.count<br />
</code></p>
<p>You can do something more elegant, like this:</p>
<p><code><br />
    assert_difference 'Membership.count' do<br />
      delete :destroy, :id =&gt; 1<br />
    end<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
