Methods
S
T
Constants
StubApp = lambda { |env| [200, {"Content-Type" => "text/html", "Content-Length" => "13"}, ["Hello, World!"]] }
 
Instance Public methods
setup()
# File actionpack/test/controller/integration_test.rb, line 10
def setup
  @session = ActionDispatch::Integration::Session.new(StubApp)
end
test_delete()
# File actionpack/test/controller/integration_test.rb, line 96
def test_delete
  path = "/index"; params = "blah"; headers = {:location => 'blah'}
  @session.expects(:process).with(:delete,path,params,headers)
  @session.delete(path,params,headers)
end
test_delete_via_redirect()
# File actionpack/test/controller/integration_test.rb, line 72
def test_delete_via_redirect
  path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue" }
  @session.expects(:request_via_redirect).with(:delete, path, args, headers)
  @session.delete_via_redirect(path, args, headers)
end
test_follow_redirect_raises_when_no_redirect()
# File actionpack/test/controller/integration_test.rb, line 28
def test_follow_redirect_raises_when_no_redirect
  @session.stubs(:redirect?).returns(false)
  assert_raise(RuntimeError) { @session.follow_redirect! }
end
test_get()
# File actionpack/test/controller/integration_test.rb, line 78
def test_get
  path = "/index"; params = "blah"; headers = {:location => 'blah'}
  @session.expects(:process).with(:get,path,params,headers)
  @session.get(path,params,headers)
end
test_get_via_redirect()
# File actionpack/test/controller/integration_test.rb, line 54
def test_get_via_redirect
  path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue" }
  @session.expects(:request_via_redirect).with(:get, path, args, headers)
  @session.get_via_redirect(path, args, headers)
end
test_head()
# File actionpack/test/controller/integration_test.rb, line 102
def test_head
  path = "/index"; params = "blah"; headers = {:location => 'blah'}
  @session.expects(:process).with(:head,path,params,headers)
  @session.head(path,params,headers)
end
test_host!()
# File actionpack/test/controller/integration_test.rb, line 22
def test_host!
  assert_not_equal "glu.ttono.us", @session.host
  @session.host! "rubyonrails.com"
  assert_equal "rubyonrails.com", @session.host
end
test_https_bang_works_and_sets_truth_by_default()
# File actionpack/test/controller/integration_test.rb, line 14
def test_https_bang_works_and_sets_truth_by_default
  assert !@session.https?
  @session.https!
  assert @session.https?
  @session.https! false
  assert !@session.https?
end
test_post()
# File actionpack/test/controller/integration_test.rb, line 84
def test_post
  path = "/index"; params = "blah"; headers = {:location => 'blah'}
  @session.expects(:process).with(:post,path,params,headers)
  @session.post(path,params,headers)
end
test_post_via_redirect()
# File actionpack/test/controller/integration_test.rb, line 60
def test_post_via_redirect
  path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue" }
  @session.expects(:request_via_redirect).with(:post, path, args, headers)
  @session.post_via_redirect(path, args, headers)
end
test_put()
# File actionpack/test/controller/integration_test.rb, line 90
def test_put
  path = "/index"; params = "blah"; headers = {:location => 'blah'}
  @session.expects(:process).with(:put,path,params,headers)
  @session.put(path,params,headers)
end
test_put_via_redirect()
# File actionpack/test/controller/integration_test.rb, line 66
def test_put_via_redirect
  path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue" }
  @session.expects(:request_via_redirect).with(:put, path, args, headers)
  @session.put_via_redirect(path, args, headers)
end
test_request_via_redirect_follows_redirects()
# File actionpack/test/controller/integration_test.rb, line 40
def test_request_via_redirect_follows_redirects
  path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue"}
  @session.stubs(:redirect?).returns(true, true, false)
  @session.expects(:follow_redirect!).times(2)
  @session.request_via_redirect(:get, path, args, headers)
end
test_request_via_redirect_returns_status()
# File actionpack/test/controller/integration_test.rb, line 47
def test_request_via_redirect_returns_status
  path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue"}
  @session.stubs(:redirect?).returns(false)
  @session.stubs(:status).returns(200)
  assert_equal 200, @session.request_via_redirect(:get, path, args, headers)
end
test_request_via_redirect_uses_given_method()
# File actionpack/test/controller/integration_test.rb, line 33
def test_request_via_redirect_uses_given_method
  path = "/somepath"; args = {:id => '1'}; headers = {"X-Test-Header" => "testvalue"}
  @session.expects(:process).with(:put, path, args, headers)
  @session.stubs(:redirect?).returns(false)
  @session.request_via_redirect(:put, path, args, headers)
end
test_xml_http_request_delete()
# File actionpack/test/controller/integration_test.rb, line 138
def test_xml_http_request_delete
  path = "/index"; params = "blah"; headers = {:location => 'blah'}
  headers_after_xhr = headers.merge(
    "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest",
    "HTTP_ACCEPT"           => "text/javascript, text/html, application/xml, text/xml, */*"
  )
  @session.expects(:process).with(:delete,path,params,headers_after_xhr)
  @session.xml_http_request(:delete,path,params,headers)
end
test_xml_http_request_get()
# File actionpack/test/controller/integration_test.rb, line 108
def test_xml_http_request_get
  path = "/index"; params = "blah"; headers = {:location => 'blah'}
  headers_after_xhr = headers.merge(
    "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest",
    "HTTP_ACCEPT"           => "text/javascript, text/html, application/xml, text/xml, */*"
  )
  @session.expects(:process).with(:get,path,params,headers_after_xhr)
  @session.xml_http_request(:get,path,params,headers)
end
test_xml_http_request_head()
# File actionpack/test/controller/integration_test.rb, line 148
def test_xml_http_request_head
  path = "/index"; params = "blah"; headers = {:location => 'blah'}
  headers_after_xhr = headers.merge(
    "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest",
    "HTTP_ACCEPT"           => "text/javascript, text/html, application/xml, text/xml, */*"
  )
  @session.expects(:process).with(:head,path,params,headers_after_xhr)
  @session.xml_http_request(:head,path,params,headers)
end
test_xml_http_request_override_accept()
# File actionpack/test/controller/integration_test.rb, line 158
def test_xml_http_request_override_accept
  path = "/index"; params = "blah"; headers = {:location => 'blah', "HTTP_ACCEPT" => "application/xml"}
  headers_after_xhr = headers.merge(
    "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest"
  )
  @session.expects(:process).with(:post,path,params,headers_after_xhr)
  @session.xml_http_request(:post,path,params,headers)
end
test_xml_http_request_post()
# File actionpack/test/controller/integration_test.rb, line 118
def test_xml_http_request_post
  path = "/index"; params = "blah"; headers = {:location => 'blah'}
  headers_after_xhr = headers.merge(
    "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest",
    "HTTP_ACCEPT"           => "text/javascript, text/html, application/xml, text/xml, */*"
  )
  @session.expects(:process).with(:post,path,params,headers_after_xhr)
  @session.xml_http_request(:post,path,params,headers)
end
test_xml_http_request_put()
# File actionpack/test/controller/integration_test.rb, line 128
def test_xml_http_request_put
  path = "/index"; params = "blah"; headers = {:location => 'blah'}
  headers_after_xhr = headers.merge(
    "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest",
    "HTTP_ACCEPT"           => "text/javascript, text/html, application/xml, text/xml, */*"
  )
  @session.expects(:process).with(:put,path,params,headers_after_xhr)
  @session.xml_http_request(:put,path,params,headers)
end