Displaying 1 result from an estimated 1 matches for "invalid_email_format".
2009 Feb 28
7
be_valid (validates_format_of ..., :on => :create)
...;'s
format is valid using :on => :create, like this:
class User < ActiveRecord::Base
...
validates_format_of :email, :with => /.../, :on => :create
...
Using following code is not right:
it "should ..." do
@user = users(:example_user)
@user.email = ''invalid_email_format''
@user.save
@user.should_not be_valid
end
Even those code is not right:
it "should ... " do
@user = users(:example_user)
@user.email = ''invalid_email_format''
@user.save
@user.should be_valid
end
Thanks.