I trying to test my app, and when I do this
spec/support/devise_models.rb
module DeviseModels
class UserWithCustomEncryption < User
protected
def password_digest(password)
password.reverse
end
end
end
spec/rails_helper.rb
RSpec.configure do |config|
config.include DeviseModels
...
and when I call in my spec
UserWithCustomEncryption.new
shell show me an error
NameError:
uninitialized constant UserWithCustomEncryption
and when I include this module on the top in my spec, its work well.how fix?
sorry for my bad English
Because its namespaced, use
DeviseModels::UserWithCustomEncryption.new