mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
Support for Acceptance tests in plugins
This commit is contained in:
parent
1a82a59f47
commit
42e510753d
4 changed files with 23 additions and 0 deletions
|
@ -283,6 +283,7 @@ class Plugin::Instance
|
||||||
Rails.configuration.assets.paths << auto_generated_path
|
Rails.configuration.assets.paths << auto_generated_path
|
||||||
Rails.configuration.assets.paths << File.dirname(path) + "/assets"
|
Rails.configuration.assets.paths << File.dirname(path) + "/assets"
|
||||||
Rails.configuration.assets.paths << File.dirname(path) + "/admin/assets"
|
Rails.configuration.assets.paths << File.dirname(path) + "/admin/assets"
|
||||||
|
Rails.configuration.assets.paths << File.dirname(path) + "/test/javascripts"
|
||||||
|
|
||||||
# Automatically include rake tasks
|
# Automatically include rake tasks
|
||||||
Rake.add_rakelib(File.dirname(path) + "/lib/tasks")
|
Rake.add_rakelib(File.dirname(path) + "/lib/tasks")
|
||||||
|
|
|
@ -77,6 +77,8 @@ export default function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.get('/admin/plugins', () => { return response({ plugins: [] }); });
|
||||||
|
|
||||||
this.get('/composer-messages', () => { return response([]); });
|
this.get('/composer-messages', () => { return response([]); });
|
||||||
|
|
||||||
this.get("/latest.json", () => {
|
this.get("/latest.json", () => {
|
||||||
|
|
19
test/javascripts/plugin_tests.js.erb
Normal file
19
test/javascripts/plugin_tests.js.erb
Normal 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
|
||||||
|
%>
|
|
@ -43,6 +43,7 @@
|
||||||
//= require_tree ./fixtures
|
//= require_tree ./fixtures
|
||||||
//= require_tree ./lib
|
//= require_tree ./lib
|
||||||
//= require_tree .
|
//= require_tree .
|
||||||
|
//= require plugin_tests
|
||||||
//= require_self
|
//= require_self
|
||||||
//
|
//
|
||||||
//= require ../../public/javascripts/jquery.magnific-popup-min.js
|
//= require ../../public/javascripts/jquery.magnific-popup-min.js
|
||||||
|
|
Loading…
Reference in a new issue