Permalink
Browse files

added mounted padrino apps in sinatra_helpers_spec

  • Loading branch information...
Lester Celestial
Lester Celestial committed Mar 20, 2013
1 parent 585a4c3 commit 8103653b84622816ff9d39963b8df18ece9eaa22
Showing with 34 additions and 0 deletions.
  1. +1 −0 gemfiles/sinatra.gemfile
  2. +33 −0 spec/helpers/sinatra_helpers_spec.rb
View
@@ -8,5 +8,6 @@ gem 'sinatra-contrib', '>= 1.3'
gem 'nokogiri'
gem 'xpath'
gem 'mime-types'
+gem 'padrino-core'
gemspec :path => '../'
@@ -41,6 +41,39 @@
end
end
+ context "mounted padrino app" do
+ before do
+ Padrino.clear!
+
+ class BaseApp < Padrino::Application; end
+ class MountedApp < Padrino::Application
+
+ register Kaminari::Helpers::SinatraHelpers
+
+ controllers :users do
+ get :index do
+ @page = params[:page] || 1
+ @users = User.page(@page)
+ @options = {}
+
+ erb ERB_TEMPLATE_FOR_PAGINATE
+ end
+ end
+
+ end
+
+ Padrino.mount('base_app').to('/')
+ Padrino.mount('mounted_app').to('/admin')
+ def app
+ Rack::Lint.new(Padrino.application)
+ end
+ end
+
+ it "should do ???" do
+ # get '/admin/users'
+ end
+ end
+
context 'normal paginations with Sinatra' do
before { get '/users' }

0 comments on commit 8103653

Please sign in to comment.