From 71c4ff07ab4313c1f4781d59ad2f4528f5875665 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Tue, 19 Aug 2008 18:53:46 -0500 Subject: Delegate xhr helper method to integration session --- actionpack/test/controller/integration_test.rb | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index a709343a94..b878962df3 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -253,7 +253,10 @@ class IntegrationProcessTest < ActionController::IntegrationTest session :off def get - render :text => "OK", :status => 200 + respond_to do |format| + format.html { render :text => "OK", :status => 200 } + format.js { render :text => "JS OK", :status => 200 } + end end def post @@ -345,6 +348,20 @@ class IntegrationProcessTest < ActionController::IntegrationTest end end + def test_xml_http_request_get + with_test_route_set do + xhr :get, '/get' + assert_equal 200, status + assert_equal "OK", status_message + assert_equal "200 OK", response.headers["Status"] + assert_equal ["200 OK"], headers["status"] + assert_response 200 + assert_response :success + assert_response :ok + assert_equal "JS OK", response.body + end + end + private def with_test_route_set with_routing do |set| -- cgit v1.2.3