class TestAppendingRoutes

Public Instance Methods

setup() click to toggle source
Calls superclass method
# File actionpack/test/dispatch/routing_test.rb, line 3845
def setup
  super
  s = self
  routes = ActionDispatch::Routing::RouteSet.new
  routes.append do
    get "/hello"   => s.simple_app("fail")
    get "/goodbye" => s.simple_app("goodbye")
  end

  routes.draw do
    get "/hello" => s.simple_app("hello")
  end
  @app = self.class.build_app routes
end
simple_app(resp) click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 3841
def simple_app(resp)
  lambda { |e| [ 200, { "Content-Type" => "text/plain" }, [resp] ] }
end
test_goodbye_should_be_available() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 3860
def test_goodbye_should_be_available
  get "/goodbye"
  assert_equal "goodbye", @response.body
end
test_hello_should_not_be_overwritten() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 3865
def test_hello_should_not_be_overwritten
  get "/hello"
  assert_equal "hello", @response.body
end
test_missing_routes_are_still_missing() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 3870
def test_missing_routes_are_still_missing
  get "/random"
  assert_equal 404, @response.status
end