1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the MIT license.
require File.expand_path('../../../spec/helper', __FILE__)
class SpecAppMain < Ramaze::Controller
map '/', :core
def index
'core main'
end
end
class SpecAppTwo < Ramaze::Controller
map '/two', :core
def index
'core two'
end
end
class SpecAppOtherMain < Ramaze::Controller
map '/', :other
def index
'other main'
end
end
class SpecAppOtherTwo < Ramaze::Controller
map '/two', :other
def index
'other two'
end
end
Ramaze::App[:core].location = '/'
Ramaze::App[:other].location = '/other'
describe Ramaze::App do
behaves_like :rack_test
it 'handles call with rack env' do
get('/').body.should == 'core main'
get('/two').body.should == 'core two'
get('/other').body.should == 'other main'
get('/other/two').body.should == 'other two'
end
end
|