Revert "Testing that `paginate` helper properly works under mouted Engine"
This reverts commit e8cab2d34a
.
reason: this commit was accidentally added. I wanted to test that the helpers are working inside mouted engine on the fake app, but it turned out that this test is not really testing that...
This commit is contained in:
parent
3be5f441d0
commit
a157fe00be
|
@ -1,20 +0,0 @@
|
|||
module Engine
|
||||
class Engine < ::Rails::Engine
|
||||
isolate_namespace ::Engine
|
||||
end
|
||||
end
|
||||
|
||||
Engine::Engine.routes.draw do
|
||||
resources :users
|
||||
end
|
||||
|
||||
# controllers
|
||||
class Engine::UsersController < ::ApplicationController
|
||||
def index
|
||||
@users = User.page(params[:page]).per(3)
|
||||
render :inline => <<-ERB
|
||||
<%= @users.map(&:name).join("\n") %>
|
||||
<%= paginate @users %>
|
||||
ERB
|
||||
end
|
||||
end
|
|
@ -17,6 +17,11 @@ app.config.root = File.dirname(__FILE__)
|
|||
Rails.backtrace_cleaner.remove_silencers!
|
||||
app.initialize!
|
||||
|
||||
# routes
|
||||
app.routes.draw do
|
||||
resources :users
|
||||
end
|
||||
|
||||
#models
|
||||
require 'fake_app/active_record/models' if defined? ActiveRecord
|
||||
require 'fake_app/data_mapper/models' if defined? DataMapper
|
||||
|
@ -49,14 +54,3 @@ end
|
|||
|
||||
# helpers
|
||||
Object.const_set(:ApplicationHelper, Module.new)
|
||||
|
||||
# routes
|
||||
app.routes.draw do
|
||||
resources :users
|
||||
|
||||
if Rails.version > '3.1.0'
|
||||
$LOAD_PATH << File.join(File.dirname(__FILE__), 'engine/lib')
|
||||
require 'engine'
|
||||
mount Engine::Engine => '/engine'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
# encoding: UTF-8
|
||||
require 'spec_helper'
|
||||
|
||||
feature 'Pagination properly works in mouted Engines' do
|
||||
background do
|
||||
1.upto(10) {|i| User.create! :name => "user#{'%02d' % i}" }
|
||||
end
|
||||
scenario 'Showing normal pagination links' do
|
||||
visit '/engine/users'
|
||||
|
||||
within 'nav.pagination' do
|
||||
within 'span.page.current' do
|
||||
page.should have_content '1'
|
||||
end
|
||||
within 'span.next' do
|
||||
click_link 'Next ›'
|
||||
end
|
||||
end
|
||||
|
||||
within 'nav.pagination' do
|
||||
within 'span.page.current' do
|
||||
page.should have_content '2'
|
||||
end
|
||||
end
|
||||
end
|
||||
end if Rails.version > '3.1.0'
|
Loading…
Reference in New Issue