1
0
Fork 0
mirror of https://github.com/kbparagua/paloma synced 2023-03-27 23:21:17 -04:00

Main Spec for Rails extensions

This commit is contained in:
kbparagua 2013-10-12 19:33:44 +08:00
parent 56c62047ac
commit d5a4861c8c
3 changed files with 18 additions and 4 deletions

View file

@ -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}

View file

@ -1,2 +1,7 @@
class Admin::BarController < ApplicationController
def show
render :inline => 'Admin/Bar#show', :layout => 'application'
end
end

View file

@ -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