I have a migration that creates to boolean variables and set their
default value to false.
In a test I create an instance of this class but this variables are not
explicitly indicated so I though they should be set to false (default
value). Instead of this a test says that one variable is set to false
and the other to nil.
Do you know what is happening?
This is the test:
nextaction = Nextaction.new(:name => “”,
:project_id => “1”,
:user_id => “1”)
assert_equal nextaction.errors.length, 1
assert_equal nextaction.done, false
assert_equal nextaction.waitingfor, false
assert_equal nextaction.order, nil
and this is the part of the schema.rb refering to this table (I create
it with two migrations):
create_table “nextactions”, :force => true do |t|
t.boolean “waitingfor”, :default => false
t.boolean “done”, :default => false
and this is the result when I execute the test:
Loaded suite nextaction_test
Finished in 0.525289 seconds.
expected but was
1 tests, 5 assertions, 1 failures, 0 errors