I built a plugin last year and wanted to verify that it still works on the latest version of Discourse. After reinitializing my dev environment (I had DB migration issues) I was able to manually verify that the plugin still works. However, when I run my spec tests (which passed last year when I wrote them), I get the following error:
Failure/Error: DB.test_transaction = ActiveRecord::Base.connection.current_transaction
NoMethodError:
undefined method `test_transaction=' for #<MiniSqlMultisiteConnection:0x00007fb8b3815c40>
I also had Discourse footnote installed locally, and I get the same error when I run those tests.
Can anyone suggest how to fix my environment and/or my tests so that they pass on the current version of Discourse?
Make sure to include LOAD_PLUGINS=1 when running bin/rspec from the discourse source directory (with the plugin repo symlinked from the plugins/ folder).
I’m running the following command from the discourse directory:
d/rake plugin:spec['discourse-ruby']
@riking I’m not explicitly including LOAD_PLUGINS=1, but that seems to happen anyway (I assume since I’m doing plugin:spec). The first line after executing the command is:
It looks like the d/rake script defaults to the development environment by default so you’ll need to run the following instead: RAILS_ENV=test d/rake plugin:spec['discourse-ruby']