diff options
author | Ernie Miller <ernie@erniemiller.org> | 2012-08-23 09:02:37 -0400 |
---|---|---|
committer | Ernie Miller <ernie@erniemiller.org> | 2012-09-03 13:13:16 -0400 |
commit | eb43d3d1d94c67b3bf9c0cf576cdae8380f27260 (patch) | |
tree | 7e275b962d01cda13ce7c34c91efe9a7143173b7 /actionpack/test/dispatch/routing | |
parent | 4037e31d8874250e485ca6a27bd792a3beb13f76 (diff) | |
download | rails-eb43d3d1d94c67b3bf9c0cf576cdae8380f27260.tar.gz rails-eb43d3d1d94c67b3bf9c0cf576cdae8380f27260.tar.bz2 rails-eb43d3d1d94c67b3bf9c0cf576cdae8380f27260.zip |
Fix concerns not executing block in mapper
Also, add documentation for alternate usage.
Diffstat (limited to 'actionpack/test/dispatch/routing')
-rw-r--r-- | actionpack/test/dispatch/routing/concerns_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing/concerns_test.rb b/actionpack/test/dispatch/routing/concerns_test.rb index 8600da32ad..0289f38ba7 100644 --- a/actionpack/test/dispatch/routing/concerns_test.rb +++ b/actionpack/test/dispatch/routing/concerns_test.rb @@ -103,4 +103,14 @@ class RoutingConcernsTest < ActionDispatch::IntegrationTest assert_equal "No concern named foo was found!", e.message end + + def test_concerns_executes_block_in_context_of_current_mapper + mapper = ActionDispatch::Routing::Mapper.new(ActionDispatch::Routing::RouteSet.new) + mapper.concern :test_concern do + resources :things + return self + end + + assert_equal mapper, mapper.concerns(:test_concern) + end end |