Skip to content

Commit 349ce5b

Browse files
committed
[-] Tests - Ensure that no schema is sent during test executions
1 parent f244e64 commit 349ce5b

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

forest_liana.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
1515
s.license = "GPL-3.0"
1616

1717
s.files = Dir["{app,config,db,lib}/**/*", "LICENSE", "Rakefile", "README.rdoc"]
18-
s.test_files = Dir["test/**/*"]
18+
s.test_files = Dir["test/**/*", "spec/**/*"]
1919

2020
s.add_runtime_dependency "rails", ">= 4.0"
2121
s.add_runtime_dependency "jsonapi-serializers", ">= 0.14.0"

lib/forest_liana/engine.rb

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,19 @@ def eager_load_active_record_descendants app
6161
end
6262

6363
config.after_initialize do |app|
64-
if !Rails.env.test?
65-
if error
66-
FOREST_LOGGER.error "Impossible to set the whitelisted Forest " \
67-
"domains for CORS constraint:\n#{error}"
68-
end
64+
if error
65+
FOREST_LOGGER.error "Impossible to set the whitelisted Forest " \
66+
"domains for CORS constraint:\n#{error}"
67+
end
6968

70-
eager_load_active_record_descendants(app)
69+
eager_load_active_record_descendants(app)
7170

72-
if database_available?
73-
# NOTICE: Do not run the code below on rails g forest_liana:install.
74-
if ForestLiana.env_secret || ForestLiana.secret_key
75-
unless rake?
76-
bootstraper = Bootstraper.new
77-
bootstraper.synchronize unless ENV['FOREST_DEACTIVATE_AUTOMATIC_APIMAP']
78-
end
71+
if database_available?
72+
# NOTICE: Do not run the code below on rails g forest_liana:install.
73+
if ForestLiana.env_secret || ForestLiana.secret_key
74+
unless rake?
75+
bootstraper = Bootstraper.new
76+
bootstraper.synchronize unless ENV['FOREST_DEACTIVATE_AUTOMATIC_APIMAP'] || Rails.env.test?
7977
end
8078
end
8179
end

0 commit comments

Comments
 (0)