2017-07-24 16:20:53 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-06 12:54:50 -04:00
|
|
|
require "abstract_unit"
|
2012-02-22 13:59:47 -05:00
|
|
|
|
|
|
|
module ActionDispatch
|
|
|
|
module Routing
|
|
|
|
class HelperTest < ActiveSupport::TestCase
|
|
|
|
class Duck
|
|
|
|
def to_param
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_exception
|
|
|
|
rs = ::ActionDispatch::Routing::RouteSet.new
|
|
|
|
rs.draw do
|
|
|
|
resources :ducks do
|
|
|
|
member do
|
|
|
|
get :pond
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
x = Class.new {
|
|
|
|
include rs.url_helpers
|
|
|
|
}
|
2013-07-17 03:56:34 -04:00
|
|
|
assert_raises ActionController::UrlGenerationError do
|
2012-02-22 13:59:47 -05:00
|
|
|
x.new.pond_duck_path Duck.new
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|