mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
DEV: Support for running theme test with Ember CLI (third attempt)
The second attempt fixed issues with smoke test. This one makes sure minification only happens in production mode.
This commit is contained in:
@ -13,9 +13,11 @@ module ApplicationHelper
|
||||
@extra_body_classes ||= Set.new
|
||||
end
|
||||
|
||||
def discourse_config_environment
|
||||
def discourse_config_environment(testing: false)
|
||||
|
||||
# TODO: Can this come from Ember CLI somehow?
|
||||
{ modulePrefix: "discourse",
|
||||
config = {
|
||||
modulePrefix: "discourse",
|
||||
environment: Rails.env,
|
||||
rootURL: Discourse.base_path,
|
||||
locationType: "auto",
|
||||
@ -32,7 +34,16 @@ module ApplicationHelper
|
||||
version: "#{Discourse::VERSION::STRING} #{Discourse.git_version}",
|
||||
exportApplicationGlobal: true
|
||||
}
|
||||
}.to_json
|
||||
}
|
||||
|
||||
if testing
|
||||
config[:environment] = "test"
|
||||
config[:locationType] = "none"
|
||||
config[:APP][:autoboot] = false
|
||||
config[:APP][:rootElement] = '#ember-testing'
|
||||
end
|
||||
|
||||
config.to_json
|
||||
end
|
||||
|
||||
def google_universal_analytics_json(ua_domain_name = nil)
|
||||
|
Reference in New Issue
Block a user