spec/contrib/addressable_route.rb in manveru-ramaze-2009.06.12 vs spec/contrib/addressable_route.rb in manveru-ramaze-2009.07
- old
+ new
@@ -1,6 +1,6 @@
-require 'spec/helper'
+require File.expand_path('../../../spec/helper', __FILE__)
require 'ramaze/contrib/addressable_route'
class SpecAddressableRoute < Ramaze::Controller
map '/'
@@ -10,14 +10,12 @@
end
describe 'addressable routing' do
behaves_like :rack_test
- RAR = Ramaze::AddressableRoute
- RAR.map('/customer/{customer_id}/order/{order_id}', '/order/show')
-
Ramaze.middleware! :spec do |m|
- m.use RAR
+ m.use(Ramaze::AddressableRoute,
+ '/customer/{customer_id}/order/{order_id}' => '/order/show')
m.run Ramaze::AppMap
end
it 'should route based on URI template' do
body = eval(get('/customer/12/order/15').body)