Sha256: cf5d5aa9b458db3a99eb2db4e64024f7abc0f3c991705933018a679d45c26d6b

Contents?: true

Size: 1.39 KB

Versions: 23

Compression:

Stored size: 1.39 KB

Contents

require 'spec/spec_helper'

class ControllerWithRadiantLayout < ApplicationController
  radiant_layout 'main'
end

class ControllerWithRadiantLayoutBlock < ApplicationController
  radiant_layout {|c| c.action_name == "index" ? "main" : "utf8"}
end
  
describe ControllerWithRadiantLayout do  
  dataset :layouts
  
  before(:each) do
    layouts(:main)
  end
    
  it "should have radiant layout attribute" do
    ControllerWithRadiantLayout.read_inheritable_attribute('radiant_layout').should == 'main'
    # This doesn't seem to work anymore, but calling "active_layout" on an instance still correctly returns "layouts/radiant.rhtml"
    #ControllerWithRadiantLayout.read_inheritable_attribute('layout').should == 'radiant'
  end
  
  it "should return 'radiant' when read_inheritable_attribute('layout') is called"
  
end
  
describe ControllerWithRadiantLayoutBlock do  
  dataset :layouts
  
  before(:each) do
    layouts(:main)
  end
  
  it "should have radiant layout block" do
    ControllerWithRadiantLayoutBlock.read_inheritable_attribute('radiant_layout').should be_kind_of(Proc)
    # This doesn't seem to work anymore, but calling "active_layout" on an instance still correctly returns "layouts/radiant.rhtml"
    #ControllerWithRadiantLayoutBlock.read_inheritable_attribute('layout').should == 'radiant'
  end
  
  it "should return 'radiant' when read_inheritable_attribute('layout') is called"
  
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
trusty-layouts-extension-3.1.1 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-3.1.0 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-3.0.0 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-2.0.4 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-2.0.3 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-2.0.2 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-2.0.1 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-2.0.0.pre.beta spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-1.1.0 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-1.0.4 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-1.0.3 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-1.0.2 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-1.0.1 spec/lib/share_layouts/controllers/action_controller_spec.rb
trusty-layouts-extension-1.0.0 spec/lib/share_layouts/controllers/action_controller_spec.rb
radiant-layouts-extension-1.1.3 spec/lib/share_layouts/controllers/action_controller_spec.rb
radiant-layouts-extension-1.1.2 spec/lib/share_layouts/controllers/action_controller_spec.rb
radiant-layouts-extension-1.1.1 spec/lib/share_layouts/controllers/action_controller_spec.rb
radiant-layouts-extension-1.1.0 spec/lib/share_layouts/controllers/action_controller_spec.rb
radiant-layouts-extension-1.0.4 spec/lib/share_layouts/controllers/action_controller_spec.rb
radiant-layouts-extension-1.0.3 spec/lib/share_layouts/controllers/action_controller_spec.rb