Hello champs,

I have a validation in model ABC and that is:-
validates_presence_of :employee_id
Now the record should not be saved without the presence of employee_id
right. But now i wrote a test case like this:-

def test_should_not_save_abcModel_without_employee_id
  abc = Abc.new(:name => "ABC Group")
  assert abc.save, "Saving the record without employee_id"
end

But still this record gets saved in database. Why so .. ? What i am
doing wrong here.. My database migrations for employee_id column as
well:-

t.integer            :employee_id,    :null => false
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to