I'm writing some specs for my User model but the tests are not passing. I'm fallowing this from the github page of the gem without success. This is my code:
validates :phone, numericality: { only_integer: true }, allow_blank: true, length: { is: 7 }
validates :mobile, numericality: { only_integer: true }, allow_blank: true, length: { is: 10 }
and my specs
it { should ensure_length_of(:phone).is_equal_to(7) }
it { should ensure_length_of(:mobile).is_equal_to(10) }
This validations should only run during the update process.
The errors:
Did not expect errors to include "longitud errónea (debe ser de 7 caracteres)" when telefono is set to "xxxxxxx", got error: longitud errónea (debe ser de 7 caracteres)
Did not expect errors to include "longitud errónea (debe ser de 10 caracteres)" when celular is set to "xxxxxxxxxx", got error: longitud errónea (debe s er de 10 caracteres)
FYI: I've set Spanish Locales; I think this is the cause
Hope someone could help me. Thanks is advance