Compartmentalize test helper support

This commit is contained in:
Benjamin Fleischer
2015-08-21 02:23:34 -04:00
parent 49ea8bde86
commit 530a1bdfd7
4 changed files with 83 additions and 77 deletions

21
test/support/rails_app.rb Normal file
View File

@@ -0,0 +1,21 @@
class Foo < Rails::Application
if Rails::VERSION::MAJOR >= 4
config.eager_load = false
config.secret_key_base = 'abc123'
config.action_controller.perform_caching = true
config.active_support.test_order = :random
config.logger = Logger.new(nil)
ActionController::Base.cache_store = :memory_store
end
end
Foo.initialize!
module TestHelper
Routes = ActionDispatch::Routing::RouteSet.new
Routes.draw do
get ':controller(/:action(/:id))'
get ':controller(/:action)'
end
ActionController::Base.send :include, Routes.url_helpers
end