diff options
author | Michael Koziarski <michael@koziarski.com> | 2005-10-06 04:15:14 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2005-10-06 04:15:14 +0000 |
commit | 656fb866f91a87677ce501d3c9ad6aba9048d00f (patch) | |
tree | c6db1f2d6fc045aa428cc7575aec87e74f1f8957 /activerecord/test/base_test.rb | |
parent | 0639e1ca7c63afa79b54cc1eb73871026f9b473d (diff) | |
download | rails-656fb866f91a87677ce501d3c9ad6aba9048d00f.tar.gz rails-656fb866f91a87677ce501d3c9ad6aba9048d00f.tar.bz2 rails-656fb866f91a87677ce501d3c9ad6aba9048d00f.zip |
Quote booleans according the rules defined by the adapter
* SQLite schema has been updated
* Postgresql schema needs to be fixed too
Simplify AR::Base#toggle to store the boolean, not the quoted value
* expand the tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/base_test.rb')
-rwxr-xr-x | activerecord/test/base_test.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 50d1673361..fd5e439ef4 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -380,7 +380,7 @@ class BasicsTest < Test::Unit::TestCase end def test_update_by_condition - Topic.update_all "content = 'bulk updated!'", "approved = 1" + Topic.update_all "content = 'bulk updated!'", ["approved = ?", true] assert_equal "Have a nice day", Topic.find(1).content assert_equal "bulk updated!", Topic.find(2).content end @@ -812,6 +812,11 @@ class BasicsTest < Test::Unit::TestCase assert !topics(:first).approved? topics(:first).toggle!(:approved) assert topics(:first).approved? + topic = topics(:first) + topic.toggle(:approved) + assert !topic.approved? + topic.reload + assert topic.approved? end def test_reload |