From 461dce13ae6db3db60256248c1696a6d1660b0c1 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 14 Aug 2006 23:14:08 +0000 Subject: [PATCH] Fix AWS tests git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../action_controller_dispatcher.rb | 4 ++++ actionwebservice/test/abstract_client.rb | 1 - actionwebservice/test/abstract_unit.rb | 19 +++++++++++-------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb index a338aedbc1..a959150f9d 100644 --- a/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb +++ b/actionwebservice/lib/action_web_service/dispatcher/action_controller_dispatcher.rb @@ -37,6 +37,10 @@ module ActionWebService # :nodoc: module InstanceMethods # :nodoc: private def dispatch_web_service_request + if request.get? + render_text('GET not supported', '500 GET not supported') + return + end exception = nil begin ws_request = discover_web_service_request(request) diff --git a/actionwebservice/test/abstract_client.rb b/actionwebservice/test/abstract_client.rb index 5207d8ef21..467c4e0d5b 100644 --- a/actionwebservice/test/abstract_client.rb +++ b/actionwebservice/test/abstract_client.rb @@ -69,7 +69,6 @@ module ClientTest attr_accessor :value_named_parameters def initialize - @session = @assigns = {} @value_void = nil @value_normal = nil @value_array_return = nil diff --git a/actionwebservice/test/abstract_unit.rb b/actionwebservice/test/abstract_unit.rb index 392951ede7..3afd928561 100644 --- a/actionwebservice/test/abstract_unit.rb +++ b/actionwebservice/test/abstract_unit.rb @@ -9,7 +9,7 @@ require 'action_web_service' require 'action_controller' require 'action_controller/test_process' -ActionController::Base.logger = nil +ActionController::Base.logger = Logger.new("debug.log") ActionController::Base.ignore_missing_templates = true begin @@ -20,13 +20,16 @@ rescue Object => e fail "\nFailed to load activerecord: #{e}" end -ActiveRecord::Base.establish_connection( - :adapter => "mysql", - :username => "rails", - :encoding => "utf8", - :database => "actionwebservice_unittest" -) -ActiveRecord::Base.connection +ActiveRecord::Base.configurations = { + 'mysql' => { + :adapter => "mysql", + :username => "rails", + :encoding => "utf8", + :database => "actionwebservice_unittest" + } +} + +ActiveRecord::Base.establish_connection 'mysql' Test::Unit::TestCase.fixture_path = "#{File.dirname(__FILE__)}/fixtures/"