Permalink
Browse files

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
  • Loading branch information...
1 parent e899190 commit 53737eadd6ee69b81f50029908502fa43dc9fe95 @jamis jamis committed Oct 4, 2006
Showing with 13 additions and 0 deletions.
  1. +13 −0 activerecord/test/callbacks_test.rb
View
13 activerecord/test/callbacks_test.rb
@@ -109,6 +109,13 @@ def before_destroy
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 @@ def test_before_save_returning_false
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

0 comments on commit 53737ea

Please sign in to comment.