samedi 19 janvier 2019

Rails 6 unitialized constant ActiveModel::SecurePassword::InstanceMethodsOnActivation

I'm trying to update a rails 5.2 app to the rails 6 beta, and everything seems to be working fine except for my validate_presence_of specs.

For example

RSpec.describe Post, type: :model do
  context 'validations' do
    subject { Post.new(body: Faker::Movie.quote)}
    it { should validate_presence_of :body }
    it { should validate_length_of(:body).is_at_most(5000).on(:create) }
  end
end

the validate_length_of passes fine, and the validate_presence of does not. Posts do belong to a user that inherits from a Clearance::User, but I'm not sure why the constant would vary on different tests for the same model?

Aucun commentaire:

Enregistrer un commentaire