class Rack::TestCase

Temporary base class

Public Class Methods

testing(klass = nil) click to toggle source
# File test/abstract_unit.rb, line 172
def self.testing(klass = nil)
  if klass
    @testing = "/#{klass.name.underscore}".sub!(/_controller$/, '')
  else
    @testing
  end
end

Public Instance Methods

assert_body(body) click to toggle source
# File test/abstract_unit.rb, line 188
def assert_body(body)
  assert_equal body, Array.wrap(response.body).join
end
assert_content_type(type) click to toggle source
# File test/abstract_unit.rb, line 204
def assert_content_type(type)
  assert_equal type, response.headers["Content-Type"]
end
assert_header(name, value) click to toggle source
# File test/abstract_unit.rb, line 208
def assert_header(name, value)
  assert_equal value, response.headers[name]
end
assert_response(body, status = 200, headers = {}) click to toggle source
# File test/abstract_unit.rb, line 196
def assert_response(body, status = 200, headers = {})
  assert_body   body
  assert_status status
  headers.each do |header, value|
    assert_header header, value
  end
end
assert_status(code) click to toggle source
# File test/abstract_unit.rb, line 192
def assert_status(code)
  assert_equal code, response.status
end
get(thing, *args) click to toggle source
# File test/abstract_unit.rb, line 180
def get(thing, *args)
  if thing.is_a?(Symbol)
    super("#{self.class.testing}/#{thing}", *args)
  else
    super
  end
end