diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-12 08:52:08 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-12 08:52:08 +0000 |
commit | c62e5e1a3a60c2360ae5a356bf7697dd4417ecb6 (patch) | |
tree | 3e66b5b598f0e501350f435c959093d50271ccdb /activerecord | |
parent | a66ad97dacdf8eed775b35fdfd0e569323f43242 (diff) | |
download | rails-c62e5e1a3a60c2360ae5a356bf7697dd4417ecb6.tar.gz rails-c62e5e1a3a60c2360ae5a356bf7697dd4417ecb6.tar.bz2 rails-c62e5e1a3a60c2360ae5a356bf7697dd4417ecb6.zip |
Demonstrate that a value's required. References #6156.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5903 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/defaults_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/defaults_test.rb b/activerecord/test/defaults_test.rb index 3043871f77..cf99978f9e 100644 --- a/activerecord/test/defaults_test.rb +++ b/activerecord/test/defaults_test.rb @@ -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 |