From 7c7aaec7f1785f913012eebda0dfb94a841b1300 Mon Sep 17 00:00:00 2001 From: Loic Dachary <loic@dachary.org> Date: Wed, 13 Jul 2016 23:24:15 +0200 Subject: [PATCH] explain how to run tests for a given plugin See https://meta.discourse.org/t/how-do-i-run-only-discourse-plugins-poll-spec/47244/5 for the corresponding discussion. Signed-off-by: Loic Dachary <loic@dachary.org> --- docs/VAGRANT.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/VAGRANT.md b/docs/VAGRANT.md index f1393aa96ee..e698e59ea19 100644 --- a/docs/VAGRANT.md +++ b/docs/VAGRANT.md @@ -118,6 +118,18 @@ RAILS_ENV=test bundle exec rake db:migrate bundle exec rake autospec p l=5 ``` +When developing a plugin (the *poll* plugin for instance), the following can be used to only run all tests from the *spec* directory: + +``` +bundle exec rake plugin:spec poll +``` + +or just a single file with: + +``` +LOAD_PLUGINS=1 bundle exec rspec plugins/poll/spec/controllers/posts_controller_spec.rb +``` + For more insight into testing Discourse, see [this discussion](http://rubyrogues.com/117-rr-discourse-part-2-with-sam-saffron-and-robin-ward/) with the Ruby Rogues. ### Sending Email