You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class User
normalize :email, with: :strip_downcase
end
Spec: it { is_expected.to validate_uniqueness_of(:email).with_message('an account with this email address already exists').case_insensitive }
Error:
1) User Validations Email validations should require unique value for email
Failure/Error: it { is_expected.to validate_uniqueness_of(:email).with_message('an account with this email address already exists').case_insensitive }
Shoulda::Matchers::ActiveModel::AllowValueMatcher::CouldNotSetAttributeError:
The allow_value matcher attempted to set :email on User to "A", but
when the attribute was read back, it had stored "a" instead.
Guys, what is the right way to test attributes which values can be changed on the fly?
With this line commented all works fine (allow_value_matcher.rb):
# ensure_that_attribute_was_set!(value)
The text was updated successfully, but these errors were encountered:
Hi, guys!
Given: https://github.com/dimko/normalizr
Spec:
it { is_expected.to validate_uniqueness_of(:email).with_message('an account with this email address already exists').case_insensitive }
Error:
Guys, what is the right way to test attributes which values can be changed on the fly?
With this line commented all works fine (allow_value_matcher.rb):
# ensure_that_attribute_was_set!(value)
The text was updated successfully, but these errors were encountered: