<p>I'm writing a Rails plugin that includes some partials.  I'd like to test the partials, but I'm having a hard time setting up a test that will render them.  There's no associated controller, so I'm just faking one:</p>

<pre><code>require 'action_controller'
require 'active_support'
require 'action_pack'
require 'action_view'

class MyTest &lt; Test::Unit::TestCase
  def setup
    @renderer = ActionController::Base.new
    @renderer.append_view_path File.expand_path(File.join(File.dirname(__FILE__), '..', 'views'))
  end

  def test_renders_link
    result = @renderer.render(:partial =&gt; '/something')
    assert ...
  end
end
</code></pre>

<p>But that <code>:render</code> call always blows up.  I've tried using an <code>ActionView::Base</code> instead of an <code>ActionController::Base</code>, but that gets even less far.</p>

<p>Has anyone had any success?</p>

checkout ActionView::TestCase -
http://api.rubyonrails.org/classes/ActionView/TestCase.html
You can also use these to test helpers, which I've found extremely helpful.
RSpec also has a way to test views:
http://rspec.info/documentation/rails/writing/views.html
Hope that helps!