Rails 3.1 layout specified in controller not overriding layout from parent controller when using Capybara / Selenium

I have a basic controller

class Admin::BaseController < ApplicationController
  before_filter :authenticate_admin!

  layout 'admin'


inherited by another controller

class Admin::AdminsController < Admin::BaseController
  layout 'admin_bootstrap'




If the child controller overrides the layout specified in the parent controller.

When viewed while the server is running, everything works as expected.

But when I run cucumber tests, the pages are rendered using the "admin" layout, not the "admin_bootstrap" layout.

I am currently moving this part of the site to use the twitter bootstrap framework and do it function by function (controller by controller), but this is tiring the ghost of a little thing since the expected javascript functions are not working (since the source files are not included in the admin layout but are located in the admin_bootstrap layout).

I'm sure I'm just missing something silly.

Any advice is appreciated.

Best, Tom


source to share

All Articles