Validates_uniqueness_of does not pass unit test

I am doing some very very basic unit testing. If I take away the
uniqueness validation, the tests pass. Could this be a bug in Edge

Hi, could you post the test?



In my model:
validates_uniqueness_of :number, :scope => :school_id

Unit test:
def test_student_CRUD
student = :school_id => @john.school_id, :number =>

student_copy = Student.find(
assert_equal student.number, student_copy.number
student.number = "7777"
assert student.destroy


id: 1
school_id: 1
account_id: 1
family_id: NULL
first_name: John
last_name: Doe
number: 9999

Thanks for any help!

So what actually happens when you run this test, and what are you
expecting it to do?

My reading says that it should fail on the first line.
(And the test will, of course, pass if you remove the uniqueness

You are correct, it fails on the on the save. If I remove it, it does
pass. I want it to pass with the validation.

Why does it fail on the line? the number is unique as
there are no other student fixtures.