<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/rails/matchers/render_template_spec.rb</filename>
    </added>
    <added>
      <filename>spec_resources/views/layouts/application.rhtml</filename>
    </added>
    <added>
      <filename>spec_resources/views/layouts/simple.rhtml</filename>
    </added>
    <added>
      <filename>spec_resources/views/render_spec/action_with_alternate_layout.rhtml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -183,30 +183,21 @@ module Spec
               unless integrate_views?
                 if @template.respond_to?(:finder)
                   (class &lt;&lt; @template.finder; self; end).class_eval do
-                    define_method :file_exists? do
-                      true
-                    end
+                    define_method :file_exists? do; true; end
                   end
                 else
                   (class &lt;&lt; @template; self; end).class_eval do
-                    define_method :file_exists? do
-                      true
-                    end
+                    define_method :file_exists? do; true; end
                   end
                 end
                 (class &lt;&lt; @template; self; end).class_eval do
                   define_method :render_file do |*args|
-                    @first_render ||= args[0] 
+                    @first_render ||= args[0] unless args[0] =~ /^layouts/
                   end
                   
                   define_method :pick_template do |*args|
-                    @_first_render = args[0]
-                    Class.new do
-                      def render_template(*ignore_args)
-                      end
-                      def render_partial(*ignore_args)
-                      end
-                    end.new
+                    @_first_render ||= args[0] unless args[0] =~ /^layouts/
+                    PickedTemplate.new
                   end
                 end
               end
@@ -278,6 +269,11 @@ module Spec
 
         Spec::Example::ExampleGroupFactory.register(:controller, self)
       end
+      
+      class PickedTemplate
+        def render_template(*ignore_args); end
+        def render_partial(*ignore_args);  end
+      end
     end
   end
 end</diff>
      <filename>lib/spec/rails/example/controller_example_group.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,19 +10,16 @@ module Spec
         end
       
         def matches?(response)
+          
           if response.respond_to?(:rendered_file)
             @actual = response.rendered_file
-            full_path(@actual) == full_path(@expected)
           else
             @actual = response.rendered_template.to_s
-            if @expected =~ /\//
-              given_controller_path, given_file = path_and_file(@actual)
-              expected_controller_path, expected_file = path_and_file(@expected)
-              given_controller_path == expected_controller_path &amp;&amp; given_file.match(expected_file)
-            else
-              current_controller_path == controller_path_from(@actual) &amp;&amp; @actual.match(@expected)
-            end
           end
+          return false if @actual.blank?
+          given_controller_path, given_file = path_and_file(@actual)
+          expected_controller_path, expected_file = path_and_file(@expected)
+          given_controller_path == expected_controller_path &amp;&amp; given_file.match(expected_file)
         end
         
         def failure_message
@@ -41,7 +38,8 @@ module Spec
           def path_and_file(path)
             parts = path.split('/')
             file = parts.pop
-            return parts.join('/'), file
+            controller = parts.empty? ? current_controller_path : parts.join('/')
+            return controller, file
           end
         
           def controller_path_from(path)
@@ -50,11 +48,6 @@ module Spec
             parts.join('/')
           end
 
-          def full_path(path)
-            return nil if path.nil?
-            path.include?('/') ? path : &quot;#{current_controller_path}/#{path}&quot;
-          end
-        
           def current_controller_path
             @controller.class.to_s.underscore.gsub(/_controller$/,'')
           end</diff>
      <filename>lib/spec/rails/matchers/render_template.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,4 +23,8 @@ class RenderSpecController &lt; ApplicationController
   def action_that_renders_nothing
     render :nothing =&gt; true
   end
+  
+  def action_with_alternate_layout
+    render :layout =&gt; 'simple'
+  end
 end</diff>
      <filename>spec_resources/controllers/render_spec_controller.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>spec/rails/matchers/render_spec.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>68226c616856554fd1d68af959fbdb94b0e46b78</id>
    </parent>
  </parents>
  <author>
    <name>David Chelimsky</name>
    <email>david@david-chelimskys-macbook-pro.local</email>
  </author>
  <url>http://github.com/ianwhite/rspec-rails/commit/e11c5b58f1a85dbd260bca96410740c12fda21f4</url>
  <id>e11c5b58f1a85dbd260bca96410740c12fda21f4</id>
  <committed-date>2008-08-25T06:15:31-07:00</committed-date>
  <authored-date>2008-08-25T06:15:31-07:00</authored-date>
  <message>'should render_template' ignores layouts [#508 state:resolved]</message>
  <tree>9189740b6bfecf2401d8697a71b937e02a4d18f0</tree>
  <committer>
    <name>David Chelimsky</name>
    <email>david@david-chelimskys-macbook-pro.local</email>
  </committer>
</commit>
