mirror of
https://github.com/github/rails.git
synced 2026-01-28 15:58:03 -05:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user