From 47a0392b77bcc7623d4a49fd49bf8725e0bf75d0 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Tue, 18 Nov 2014 17:23:04 +0800 Subject: [PATCH] Ensure route matcher works with namespaced controllers --- .../action_controller/route_matcher_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/unit/shoulda/matchers/action_controller/route_matcher_spec.rb b/spec/unit/shoulda/matchers/action_controller/route_matcher_spec.rb index fa0b6eb5..c5661a2e 100644 --- a/spec/unit/shoulda/matchers/action_controller/route_matcher_spec.rb +++ b/spec/unit/shoulda/matchers/action_controller/route_matcher_spec.rb @@ -107,4 +107,19 @@ describe 'Shoulda::Matchers::ActionController::RouteMatcher', type: :controller end end end + + context 'given a controller that is namespaced' do + it_behaves_like 'a controller with a defined route' do + def controller + @_controller ||= begin + define_module('Admin') + define_controller('Admin::Examples').new + end + end + + def controller_name + 'admin/examples' + end + end + end end