Not sure how it works with autospec since I’m running the specs manually most of the time.
In order to run the plugin specs I’m always setting an environment variable in my IDE: LOAD_PLUGINS=1
# this runs just the specs in one file
LOAD_PLUGINS=1 bundle exec rspec plugins/poll/spec/controllers/posts_controller_spec.rb
# this runs all the specs of the poll plugin
LOAD_PLUGINS=1 bundle exec rspec plugins/poll/spec
It works, thanks ! Where would be the most relevant topic for this information ? Or maybe there is a file in the git repository that should be updated ? The closest thing I found is the Beginner’s Guide to Creating Discourse Plugins Part 6: Acceptance Tests but it only covers part of the qunit tests.
@sam добавил здесь немного магии, так что если вы выполните RAILS_ENV=test /bin/rake db:migrate, плагины будут автоматически загружены. Но я думаю, что большинство людей не используют bin-заглушки, поэтому эта проблема продолжает возникать у разных пользователей. Возможно, нам нужно внедрить эту логику непосредственно в задачу rake db:migrate, а не в bin-заглушку
При обычном запуске тестового набора мы не хотим загружать плагины — часто они переопределяют функциональность и могут привести к сбоям основных тестов.