<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -44,5 +44,42 @@ describe ActionView::Base, &quot;with RSpec extensions:&quot;, :type =&gt; :view do
       template.render(:partial =&gt; &quot;name&quot;)
     end
   end
-
 end
+
+describe &quot;When render_partial has been previously alias_method_chained&quot; do
+  before(:all) do
+    # mess with a copy of ActionView::Base
+    @orig_action_view_base = ActionView::Base
+    ActionView.send :remove_const, :Base
+    ActionView::Base = @orig_action_view_base.clone
+    
+    # set up the alias_method_chain
+    ActionView::Base.class_eval do
+      def render_partial_with_chain(*args)
+        chain_method_called
+      end
+      alias_method_chain :render_partial, :chain
+    end
+    
+    #&#160;now run the rspec extension stuff (it has to be after the chain)
+    Kernel.eval File.read(File.join(File.dirname(__FILE__), '../../../lib/spec/rails/extensions/action_view/base.rb'))
+  end
+  
+  describe &quot;#render_partial&quot;, :type =&gt; :view do
+    before do
+      @view = ActionView::Base.new
+      @view.stub!(:chain_method_called)
+    end
+
+    it &quot;should call the chained method&quot; do
+      @view.should_receive :chain_method_called
+      @view.render_partial('some/partial')
+    end
+  end
+  
+  after(:all) do
+    # set ActionView back to how it was
+    ActionView.send :remove_const, :Base
+    ActionView::Base = @orig_action_view_base
+  end
+end
\ No newline at end of file</diff>
      <filename>spec/rails/extensions/action_view_base_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bbdc0ab62264562de27afaa3f1e22e2e5d7a26f9</id>
    </parent>
  </parents>
  <author>
    <name>Ian White</name>
    <email>ian.w.white@gmail.com</email>
  </author>
  <url>http://github.com/ianwhite/rspec-rails/commit/51477e207ad3ceb2fb8023b0e8ce09f0637188f5</url>
  <id>51477e207ad3ceb2fb8023b0e8ce09f0637188f5</id>
  <committed-date>2008-04-22T03:20:55-07:00</committed-date>
  <authored-date>2008-04-22T03:20:55-07:00</authored-date>
  <message>Added spec for when render_partial is aliased before rspec</message>
  <tree>52984483e68884e5e74101824efa5c91185debda</tree>
  <committer>
    <name>Ian White</name>
    <email>ian.w.white@gmail.com</email>
  </committer>
</commit>
