class Rack::TestCase
Temporary base class
Public Class Methods
testing(klass = nil)
click to toggle source
# File actionpack/test/abstract_unit.rb, line 178 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 actionpack/test/abstract_unit.rb, line 194 def assert_body(body) assert_equal body, Array(response.body).join end
assert_content_type(type)
click to toggle source
# File actionpack/test/abstract_unit.rb, line 210 def assert_content_type(type) assert_equal type, response.headers["Content-Type"] end
assert_header(name, value)
click to toggle source
# File actionpack/test/abstract_unit.rb, line 214 def assert_header(name, value) assert_equal value, response.headers[name] end
assert_response(body, status = 200, headers = {})
click to toggle source
# File actionpack/test/abstract_unit.rb, line 202 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 actionpack/test/abstract_unit.rb, line 198 def assert_status(code) assert_equal code, response.status end
get(thing, *args)
click to toggle source
Calls superclass method
TestHelpers::Rack#get
# File actionpack/test/abstract_unit.rb, line 186 def get(thing, *args) if thing.is_a?(Symbol) super("#{self.class.testing}/#{thing}", *args) else super end end