class SessionTest

Constants

StubApp

Public Instance Methods

setup() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 12
def setup
  @session = ActionDispatch::Integration::Session.new(StubApp)
end
test_delete() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 72
def test_delete
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:delete, path, params: params, headers: headers] do
    @session.delete(path, params: params, headers: headers)
  end
end
test_follow_redirect_raises_when_no_redirect() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 30
def test_follow_redirect_raises_when_no_redirect
  @session.stub :redirect?, false do
    assert_raise(RuntimeError) { @session.follow_redirect! }
  end
end
test_get() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 36
def test_get
  path = "/index"; params = "blah"; headers = { location: "blah" }

  assert_called_with @session, :process, [:get, path, params: params, headers: headers] do
    @session.get(path, params: params, headers: headers)
  end
end
test_get_with_env_and_headers() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 44
def test_get_with_env_and_headers
  path = "/index"; params = "blah"; headers = { location: "blah" }; env = { "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest" }
  assert_called_with @session, :process, [:get, path, params: params, headers: headers, env: env] do
    @session.get(path, params: params, headers: headers, env: env)
  end
end
test_head() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 79
def test_head
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:head, path, params: params, headers: headers] do
    @session.head(path, params: params, headers: headers)
  end
end
test_host!() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 24
def test_host!
  assert_not_equal "glu.ttono.us", @session.host
  @session.host! "rubyonquails.com"
  assert_equal "rubyonquails.com", @session.host
end
test_https_bang_works_and_sets_truth_by_default() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 16
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_patch() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 58
def test_patch
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:patch, path, params: params, headers: headers] do
    @session.patch(path, params: params, headers: headers)
  end
end
test_post() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 51
def test_post
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:post, path, params: params, headers: headers] do
    @session.post(path, params: params, headers: headers)
  end
end
test_put() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 65
def test_put
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:put, path, params: params, headers: headers] do
    @session.put(path, params: params, headers: headers)
  end
end
test_xml_http_request_delete() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 114
def test_xml_http_request_delete
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:delete, path, params: params, headers: headers, xhr: true] do
    @session.delete(path, params: params, headers: headers, xhr: true)
  end
end
test_xml_http_request_get() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 86
def test_xml_http_request_get
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:get, path, params: params, headers: headers, xhr: true] do
    @session.get(path, params: params, headers: headers, xhr: true)
  end
end
test_xml_http_request_head() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 121
def test_xml_http_request_head
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:head, path, params: params, headers: headers, xhr: true] do
    @session.head(path, params: params, headers: headers, xhr: true)
  end
end
test_xml_http_request_patch() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 100
def test_xml_http_request_patch
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:patch, path, params: params, headers: headers, xhr: true] do
    @session.patch(path, params: params, headers: headers, xhr: true)
  end
end
test_xml_http_request_post() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 93
def test_xml_http_request_post
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:post, path, params: params, headers: headers, xhr: true] do
    @session.post(path, params: params, headers: headers, xhr: true)
  end
end
test_xml_http_request_put() click to toggle source
# File actionpack/test/controller/integration_test.rb, line 107
def test_xml_http_request_put
  path = "/index"; params = "blah"; headers = { location: "blah" }
  assert_called_with @session, :process, [:put, path, params: params, headers: headers, xhr: true] do
    @session.put(path, params: params, headers: headers, xhr: true)
  end
end