aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-10-04 15:38:59 +0000
committerJamis Buck <jamis@37signals.com>2006-10-04 15:38:59 +0000
commit53737eadd6ee69b81f50029908502fa43dc9fe95 (patch)
treeea3176a913548be117b1626e6b7fac20ceae9aec /activerecord
parente89919082624effcd70208eb58c4e2d90b57a2a9 (diff)
downloadrails-53737eadd6ee69b81f50029908502fa43dc9fe95.tar.gz
rails-53737eadd6ee69b81f50029908502fa43dc9fe95.tar.bz2
rails-53737eadd6ee69b81f50029908502fa43dc9fe95.zip
add a failing test so we can make it happy again
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5225 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/callbacks_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/activerecord/test/callbacks_test.rb b/activerecord/test/callbacks_test.rb
index 3a4dac90cf..fa2e3da774 100644
--- a/activerecord/test/callbacks_test.rb
+++ b/activerecord/test/callbacks_test.rb
@@ -109,6 +109,13 @@ class ImmutableMethodDeveloper < ActiveRecord::Base
end
end
+class CallbackCancellationDeveloper < ActiveRecord::Base
+ set_table_name 'developers'
+ def before_create
+ false
+ end
+end
+
class CallbacksTest < Test::Unit::TestCase
fixtures :developers
@@ -334,6 +341,12 @@ class CallbacksTest < Test::Unit::TestCase
assert_raises(ActiveRecord::RecordInvalid) { david.save! }
end
+ def test_before_create_returning_false
+ someone = CallbackCancellationDeveloper.new
+ assert someone.valid?
+ assert !someone.save
+ end
+
def test_before_destroy_returning_false
david = ImmutableDeveloper.find(1)
assert !david.destroy