mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Compartmentalize test helper support
This commit is contained in:
21
test/support/rails_app.rb
Normal file
21
test/support/rails_app.rb
Normal 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
|
||||
Reference in New Issue
Block a user