Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36d9fd7
commit a328f2f
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require 'abstract_unit' | ||
|
||
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 | ||
} | ||
assert_raises ActionController::RoutingError do | ||
x.new.pond_duck_path Duck.new | ||
end | ||
end | ||
end | ||
end | ||
end |
a328f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why but I just found that running this test alone fails.
a328f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turned out that this test was not executed via
rake test
. Includingtest/routing/**/*_test.rb
inRakefile
reveals the error.The test expects
x.new.pond_duck_path Duck.new
to raise anActionController::RoutingError
but in fact it returns "/ducks//pond"@tenderlove, which is your intended behaviour?
a328f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amatsuda fixed here: 74722d6
a328f2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pixeltrix ✨