Can't run plugin:spec, SeedFu error

I used to be able to test my plugins, but after updating Discourse, I get this error on any attempt to bundle exec rake plugin:spec["PLUGIN_NAME"] when the test has require "rails_helper"

Failure/Error: SeedFu.seed

NoMethodError:
  undefined method `text_size_key' for #<UserOption:0x00007f6baa690c18>
  Did you mean?  text_size
                 text_size=
# (eval):52:in `block (2 levels) in run_file'
# ./spec/rails_helper.rb:65:in `<top (required)>'
No examples found.

Try running

RAILS_ENV=test rake db:migrate
5 Likes

This seems to have fixed it. Thanks.

In case it’s not obvious you need to do this every upgrade.

3 Likes

https://github.com/discourse/discourse/blob/master/bin/rake#L3-L8

Which is why you should always binstubs :slight_smile:

RAILS_ENV=test bin/rake db:migrate
3 Likes