test/unit/sinatra_app_tests.rb in deas-0.37.1 vs test/unit/sinatra_app_tests.rb in deas-0.38.0
- old
+ new
@@ -14,12 +14,12 @@
class UnitTests < Assert::Context
desc "Deas::SinatraApp"
setup do
@router = Deas::Router.new
- @route = @router.get('/something', 'EmptyViewHandler')
- @proxy = @route.handler_proxies[@router.default_request_type_name]
+ @router.get('/something', 'EmptyViewHandler')
+ @router.validate!
@configuration = Deas::Server::Configuration.new.tap do |c|
c.env = 'staging'
c.root = 'path/to/somewhere'
c.dump_errors = true
@@ -72,13 +72,13 @@
assert_includes "application/json", settings.add_charset
end
end
should "define Sinatra routes for every route in the configuration" do
- get_routes = subject.routes[@route.method.to_s.upcase] || []
- sinatra_route = get_routes.detect{ |route| route[0].match(@route.path) }
+ router_route = @router.routes.last
+ sinatra_routes = subject.routes[router_route.method.to_s.upcase] || []
- assert_not_nil sinatra_route
+ assert_not_nil sinatra_routes.detect{ |r| r[0].match(router_route.path) }
end
end
end