diff --git a/lib/paloma/action_controller_extension.rb b/lib/paloma/action_controller_extension.rb index 0746e5f..1f447c4 100644 --- a/lib/paloma/action_controller_extension.rb +++ b/lib/paloma/action_controller_extension.rb @@ -34,7 +34,7 @@ module Paloma # Keeps track of what Rails controller/action is executed. # def track_paloma_request - resource = controller_path.split('/').map(&:titleize).join('.') + resource = controller_path.split('/').map(&:titleize).join('/') paloma_request = {:resource => resource, :action => self.action_name} diff --git a/test_app/app/controllers/admin/bar_controller.rb b/test_app/app/controllers/admin/bar_controller.rb index ef6a3cf..f1447aa 100644 --- a/test_app/app/controllers/admin/bar_controller.rb +++ b/test_app/app/controllers/admin/bar_controller.rb @@ -1,2 +1,7 @@ class Admin::BarController < ApplicationController + + def show + render :inline => 'Admin/Bar#show', :layout => 'application' + end + end diff --git a/test_app/spec/integration/main_spec.rb b/test_app/spec/integration/main_spec.rb index f57b3b2..03df49c 100644 --- a/test_app/spec/integration/main_spec.rb +++ b/test_app/spec/integration/main_spec.rb @@ -4,6 +4,7 @@ require 'spec_helper' feature 'executing Paloma controller', :js => true do describe 'after rendering' do + it 'executes the corresponding Paloma controller action' do visit foo_path(1) called = page.evaluate_script 'window.called' @@ -35,9 +36,17 @@ feature 'executing Paloma controller', :js => true do expect(parameter).to eq 'Parameter From Paloma' end end + + + context 'from namespaced controller' do + it 'executes the corresponding Paloma controller action' do + visit admin_bar_path(1) + called = page.evaluate_script 'window.called.pop()' + + expect(called).to eq 'Admin/Bar#show' + end + end + end - - - end \ No newline at end of file