Support for Acceptance tests in plugins

This commit is contained in:
Robin Ward 2015-08-27 16:59:36 -04:00
parent 1a82a59f47
commit 42e510753d
4 changed files with 23 additions and 0 deletions

View file

@ -283,6 +283,7 @@ class Plugin::Instance
Rails.configuration.assets.paths << auto_generated_path
Rails.configuration.assets.paths << File.dirname(path) + "/assets"
Rails.configuration.assets.paths << File.dirname(path) + "/admin/assets"
Rails.configuration.assets.paths << File.dirname(path) + "/test/javascripts"
# Automatically include rake tasks
Rake.add_rakelib(File.dirname(path) + "/lib/tasks")

View file

@ -77,6 +77,8 @@ export default function() {
}
});
this.get('/admin/plugins', () => { return response({ plugins: [] }); });
this.get('/composer-messages', () => { return response([]); });
this.get("/latest.json", () => {

View file

@ -0,0 +1,19 @@
<%
DiscoursePluginRegistry.javascripts.each { |js| require_asset(js) }
DiscoursePluginRegistry.handlebars.each { |hb| require_asset(hb) }
DiscoursePluginRegistry.each_globbed_asset do |f, ext|
if File.directory?(f)
depend_on(f)
elsif f.to_s.end_with?(".#{ext}")
require_asset(f)
end
end
Discourse.plugins.each do |p|
root_path = "#{File.dirname(p.path)}/test/javascripts"
Dir.glob(root_path + '/**/**.es6').each do |f|
require_asset(f)
end
end
%>

View file

@ -43,6 +43,7 @@
//= require_tree ./fixtures
//= require_tree ./lib
//= require_tree .
//= require plugin_tests
//= require_self
//
//= require ../../public/javascripts/jquery.magnific-popup-min.js