1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Demonstrate that a value's required. References #6156.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5903 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2007-01-12 08:52:08 +00:00
parent a66ad97dac
commit c62e5e1a3a

View file

@ -35,6 +35,12 @@ class DefaultTest < Test::Unit::TestCase
assert !klass.columns_hash['omit'].null
assert_raise(ActiveRecord::StatementInvalid) { klass.create! }
assert_nothing_raised do
instance = klass.create!(:omit => 1)
assert_equal 0, instance.zero
assert_equal 1, instance.omit
end
ensure
klass.connection.drop_table(klass.table_name) rescue nil
end