public
Rubygem
Description: RSpec extension library for Ruby on Rails
Homepage:
Clone URL: git://github.com/dchelimsky/rspec-rails.git
override pick_template when isolating views (for rails edge > 2.1.0)
David Chelimsky (author)
Sun Aug 24 08:20:51 -0700 2008
commit  905614b5c0afdb411f4eb321c5857fd6e3a5c57d
tree    9c088c5d28789a031a6673a12beb894d34538333
parent  9946c4b98adcdce017eb51a585e2b3699d4aa16e
...
195
196
197
198
199
200
201
202
203
204
205
206
 
 
 
 
 
 
 
 
207
208
209
...
195
196
197
 
198
199
200
201
 
 
 
 
202
203
204
205
206
207
208
209
210
211
212
0
@@ -195,15 +195,18 @@ module Spec
0
                   end
0
                 end
0
                 (class << @template; self; end).class_eval do
0
-                  # rails <= 2.1.0
0
                   define_method :render_file do |*args|
0
                     @first_render ||= args[0] 
0
                   end
0
                   
0
-                  # rails > 2.1.0
0
-                  define_method :render do |options|
0
-                    puts options.inspect
0
-                    @_first_render ||= options[:file] || options[:partial]
0
+                  define_method :pick_template do |*args|
0
+                    @_first_render = args[0]
0
+                    Class.new do
0
+                      def render_template(*ignore_args)
0
+                      end
0
+                      def render_partial(*ignore_args)
0
+                      end
0
+                    end.new
0
                   end
0
                 end
0
               end

Comments