<?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 File Uploads with Webrat and Paperclip</title>
	<atom:link href="http://thefrontiergroup.com.au/blog/2009/06/testing-file-uploads-with-webrat-and-paperclip/feed/" rel="self" type="application/rss+xml" />
	<link>http://thefrontiergroup.com.au/blog/2009/06/testing-file-uploads-with-webrat-and-paperclip/</link>
	<description>Your peek inside the collective mind of The Frontier Group</description>
	<lastBuildDate>Thu, 11 Mar 2010 09:10:49 +0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jason Morrison</title>
		<link>http://thefrontiergroup.com.au/blog/2009/06/testing-file-uploads-with-webrat-and-paperclip/comment-page-1/#comment-437</link>
		<dc:creator>Jason Morrison</dc:creator>
		<pubDate>Thu, 08 Oct 2009 17:16:28 +0000</pubDate>
		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=389#comment-437</guid>
		<description>There was a slight typo in my last comment.  The last argument to attach_file should be content_type, not type.</description>
		<content:encoded><![CDATA[<p>There was a slight typo in my last comment.  The last argument to attach_file should be content_type, not type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Morrison</title>
		<link>http://thefrontiergroup.com.au/blog/2009/06/testing-file-uploads-with-webrat-and-paperclip/comment-page-1/#comment-436</link>
		<dc:creator>Jason Morrison</dc:creator>
		<pubDate>Thu, 08 Oct 2009 17:15:49 +0000</pubDate>
		<guid isPermaLink="false">http://thefrontiergroup.com.au/blog/?p=389#comment-436</guid>
		<description>If you&#039;re using Paperclip, it mixes Paperclip::Upfile into File, which provides a quick-and-dirty #content_type method, so you can do something like this:

    When /^I attach &quot;([^\&quot;]*)&quot; image to the &quot;([^\&quot;]*)&quot; file field$/ do &#124;filename, field&#124;
      full_file_path = File.join(RAILS_ROOT, test_asset_path, filename)
      content_type = File.new(full_file_path).content_type
      attach_file field, full_file_path, type
    end</description>
		<content:encoded><![CDATA[<p>If you&#8217;re using Paperclip, it mixes Paperclip::Upfile into File, which provides a quick-and-dirty #content_type method, so you can do something like this:</p>
<p>    When /^I attach &#8220;([^\"]*)&#8221; image to the &#8220;([^\"]*)&#8221; file field$/ do |filename, field|<br />
      full_file_path = File.join(RAILS_ROOT, test_asset_path, filename)<br />
      content_type = File.new(full_file_path).content_type<br />
      attach_file field, full_file_path, type<br />
    end</p>
]]></content:encoded>
	</item>
</channel>
</rss>
