diff options
Diffstat (limited to 'activerecord/test/base_test.rb')
-rwxr-xr-x | activerecord/test/base_test.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index 4418b8d9e6..53ef4a5e86 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -11,6 +11,7 @@ require 'fixtures/column_name' require 'fixtures/subscriber' require 'fixtures/keyboard' require 'fixtures/post' +require 'fixtures/minimalistic' class Category < ActiveRecord::Base; end class Smarts < ActiveRecord::Base; end @@ -64,7 +65,7 @@ class TopicWithProtectedContentAndAccessibleAuthorName < ActiveRecord::Base end class BasicsTest < Test::Unit::TestCase - fixtures :topics, :companies, :developers, :projects, :computers, :accounts + fixtures :topics, :companies, :developers, :projects, :computers, :accounts, :minimalistics def test_table_exists assert !NonExistentTable.table_exists? @@ -184,6 +185,15 @@ class BasicsTest < Test::Unit::TestCase assert_nil topic.title end + def test_save_for_record_with_only_primary_key + minimalistic = Minimalistic.new + assert_nothing_raised { minimalistic.save } + end + + def test_save_for_record_with_only_primary_key_that_is_provided + assert_nothing_raised { Minimalistic.create!(:id => 2) } + end + def test_hashes_not_mangled new_topic = { :title => "New Topic" } new_topic_values = { :title => "AnotherTopic" } @@ -240,6 +250,11 @@ class BasicsTest < Test::Unit::TestCase topicReloaded.send :write_attribute, 'does_not_exist', 'test' assert_nothing_raised { topicReloaded.save } end + + def test_update_for_record_with_only_primary_key + minimalistic = minimalistics(:first) + assert_nothing_raised { minimalistic.save } + end def test_write_attribute topic = Topic.new |