mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
DEV: Support for running theme test with Ember CLI
This is quite complex as it means that in production we have to build Ember CLI test files and allow them to be used by our Rails application. There is a fair bit of glue we can remove in the future once we move to Ember CLI completely.
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