Avoid warning when running tests

This commit is contained in:
Bryan Helmkamp 2008-04-04 14:19:14 +01:00
parent f7420463fd
commit a9d89d23df
3 changed files with 22 additions and 13 deletions

View File

@ -2,18 +2,23 @@ module ActionController
module Integration
class Session
# Waiting for http://dev.rubyonrails.org/ticket/10497 to be committed.
def put_via_redirect(path, parameters = {}, headers = {})
put path, parameters, headers
follow_redirect! while redirect?
status
unless instance_methods.include?("put_via_redirect")
# Waiting for http://dev.rubyonrails.org/ticket/10497 to be committed.
def put_via_redirect(path, parameters = {}, headers = {})
put path, parameters, headers
follow_redirect! while redirect?
status
end
end
# Waiting for http://dev.rubyonrails.org/ticket/10497 to be committed.
def delete_via_redirect(path, parameters = {}, headers = {})
delete path, parameters, headers
follow_redirect! while redirect?
status
unless instance_methods.include?("delete_via_redirect")
# Waiting for http://dev.rubyonrails.org/ticket/10497 to be committed.
def delete_via_redirect(path, parameters = {}, headers = {})
delete path, parameters, headers
follow_redirect! while redirect?
status
end
end
end

View File

@ -454,7 +454,7 @@ module ActionController
end
def dom # :nodoc:
return @dom if @dom
return @dom if defined?(@dom) && @dom
raise "You must visit a path before working with the page." unless response
@dom = Hpricot(response.body)
add_default_params

View File

@ -4,9 +4,13 @@ require "test/unit"
begin require "redgreen" unless ENV['TM_CURRENT_LINE']; rescue LoadError; end
require "mocha"
require "active_support"
require "action_controller"
require "action_controller/integration"
silence_warnings do
require "action_controller"
require "action_controller/integration"
end
require File.expand_path(File.dirname(__FILE__) + "/../lib/webrat")