diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-11 00:45:26 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-11 00:45:26 +0000 |
commit | b067bf788454106de761ad53af460be9fde48abd (patch) | |
tree | 941f7821900ba8288b08686b63016c2329036337 /activerecord/test | |
parent | 18e945d8872517654e087e646890bf2f8f31bc03 (diff) | |
download | rails-b067bf788454106de761ad53af460be9fde48abd.tar.gz rails-b067bf788454106de761ad53af460be9fde48abd.tar.bz2 rails-b067bf788454106de761ad53af460be9fde48abd.zip |
Added Base#attributes that returns a hash of all the attributes with their names as keys and clones of their objects as values #433 [atyp.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@386 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-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 119be8d868..da9daa6398 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -2,6 +2,7 @@ require 'abstract_unit' require 'fixtures/topic' require 'fixtures/reply' require 'fixtures/company' +require 'fixtures/project' require 'fixtures/default' require 'fixtures/auto_id' require 'fixtures/column_name' @@ -26,7 +27,7 @@ end class Booleantest < ActiveRecord::Base; end class BasicsTest < Test::Unit::TestCase - fixtures :topics, :companies + fixtures :topics, :companies, :projects def test_set_attributes topic = Topic.find(1) @@ -100,6 +101,10 @@ class BasicsTest < Test::Unit::TestCase topic.content << "five" assert_equal(%w( one two three four five ), topic.content) end + + def test_attributes_hash + assert_equal @projects["action_controller"].to_hash, @action_controller.attributes + end def test_create topic = Topic.new |