pat / combustion

Simple, elegant testing for Rails Engines
MIT License
708 stars 51 forks source link

secret_token => secret_key_base #89

Closed jrochkind closed 6 years ago

jrochkind commented 6 years ago

Running Combustion under 5.2 results in:

DEPRECATION WARNING: `secrets.secret_token` is deprecated in favor of `secret_key_base` and will be removed in Rails 6.0. (called from env_config at /Users/jrochkind/.gem/ruby/2.4.2/gems/railties-5.2.0/lib/rails/application.rb:252)
jrochkind commented 6 years ago

In my own app, which runs CI in multiple rails versions (not using appraisal, just my own hack, appraisal probably has it's own way...), I get rid of deprecation message like this:

Combustion.initialize! :all do
  case "#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}"
  when "5.0"
    # avoid deprecation notice
    config.active_record.time_zone_aware_types = [:datetime]
  when "5.2"
    config.secret_key_base = config.secret_token
    config.secret_token = nil
  end
end
pat commented 6 years ago

I've just pushed a commit to avoid setting secret_token for Rails 5.2 onwards (d22798dc5bfcef64b6dd587d769b455233fc2829). Also, secret_key_base is already being set, so for your temporary workaround, you don't need to worry about that.

Thanks for reporting the issue :) I'll push a gem release out in the next week or so.

pat commented 6 years ago

0.9.1 is now released with this fix :)