-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 6.0.0
-
Component/s: None
-
None
-
Environment:Rails 5.0.0.1
I'm trying to create a simple model and spec for the validations and it seems the ActiveModel::Validations are not working. A simple case is this:
Model:
class Account
include Mongoid::Document
include ActiveModel::Validations
field :email, type: String
validates :email, presence: true
end
Spec:
require 'rails_helper'
RSpec.describe Account, type: :model do
it "errors when with no id" do
expect
.to raise_error(Mongoid::Errors::Validations, /Validation of Account failed./)
end
end