mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Load generators on test_helper and avoid repetead code
This commit is contained in:
parent
cbc7f114c0
commit
3fb55db1cd
@ -1,12 +1,3 @@
|
||||
class Foo < Rails::Application
|
||||
if Rails.version.to_s.start_with? '4'
|
||||
config.eager_load = false
|
||||
config.secret_key_base = 'abc123'
|
||||
end
|
||||
end
|
||||
|
||||
Rails.application.load_generators
|
||||
|
||||
require 'generators/serializer/serializer_generator'
|
||||
|
||||
class SerializerGeneratorTest < Rails::Generators::TestCase
|
||||
|
||||
@ -11,11 +11,14 @@ Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
|
||||
|
||||
class Foo < Rails::Application
|
||||
if Rails.version.to_s.start_with? '4'
|
||||
config.eager_load = false
|
||||
config.secret_key_base = 'abc123'
|
||||
config.action_controller.perform_caching = true
|
||||
config.active_support.test_order = :random
|
||||
ActionController::Base.cache_store = :memory_store
|
||||
end
|
||||
end
|
||||
Foo.load_generators
|
||||
|
||||
require "active_model_serializers"
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user