Created
January 24, 2013 18:26
-
-
Save samueldana/4626086 to your computer and use it in GitHub Desktop.
Ramaze before_all hook fails when using a layout?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'ramaze' | |
require 'bacon' | |
require 'ramaze/spec/bacon' | |
Ramaze.middleware :spec do | |
run Ramaze.core | |
end | |
Ramaze::Log.level = Logger::ERROR | |
Ramaze.options.mode = :spec | |
class SpecHooksWithLayout < Ramaze::Controller | |
layout :inline_layout | |
def inline_layout; "USING LAYOUT... #{@content}"; end | |
before_all { @test = "SUCCESS" } | |
def index | |
result = @test | |
@test = "FAILURE" | |
result | |
end | |
end | |
describe 'before_all hook' do | |
behaves_like :rack_test | |
it 'should execute before_all for an action' do | |
get('/index').body.should == 'USING LAYOUT... SUCCESS' | |
get('/index').body.should == 'USING LAYOUT... SUCCESS' # Fails | |
end | |
it 'should execute before_all for an action alias' do | |
get('/').body.should == 'USING LAYOUT... SUCCESS' | |
get('/').body.should == 'USING LAYOUT... SUCCESS' # Fails | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment