From eb43d3d1d94c67b3bf9c0cf576cdae8380f27260 Mon Sep 17 00:00:00 2001 From: Ernie Miller Date: Thu, 23 Aug 2012 09:02:37 -0400 Subject: Fix concerns not executing block in mapper Also, add documentation for alternate usage. --- actionpack/test/dispatch/routing/concerns_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test/dispatch') 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 -- cgit v1.2.3