Ticket #6684: fix_actioncontroller_base_render_text_handles_false_object-v2.diff
| File fix_actioncontroller_base_render_text_handles_false_object-v2.diff, 1.3 kB (added by PotatoSalad, 10 months ago) |
|---|
-
actionpack/test/controller/render_test.rb
old new 37 37 render :text => "hello world" 38 38 end 39 39 40 def render_text_false 41 # Simulating a model returning a boolean attribute 42 render :text => "foo".blank? 43 end 44 40 45 def render_json_hello_world 41 46 render :json => {:hello => 'world'}.to_json 42 47 end … … 233 238 assert_equal "hello world", @response.body 234 239 end 235 240 241 def test_render_text_false 242 get :render_text_false 243 assert_equal false, @response.body 244 end 245 236 246 def test_render_json 237 247 get :render_json_hello_world 238 248 assert_equal '{"hello": "world"}', @response.body -
actionpack/lib/action_controller/base.rb
old new 850 850 response.headers["Location"] = url_for(location) 851 851 end 852 852 853 if text = options[:text]854 render_for_text( text, options[:status])853 if options.has_key?(:text) 854 render_for_text(options[:text], options[:status]) 855 855 856 856 else 857 857 if file = options[:file]