diff options
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/fixtures/db_definitions/postgresql.sql | 2 | ||||
-rw-r--r-- | activerecord/test/reflection_test.rb | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/fixtures/db_definitions/postgresql.sql b/activerecord/test/fixtures/db_definitions/postgresql.sql index 2fd210cb1b..6eb2304957 100644 --- a/activerecord/test/fixtures/db_definitions/postgresql.sql +++ b/activerecord/test/fixtures/db_definitions/postgresql.sql @@ -50,10 +50,10 @@ CREATE TABLE topics ( bonus_time time, last_read date, content text, + approved smallint DEFAULT 1, replies_count integer default 0, parent_id integer, "type" character varying(50), - approved smallint DEFAULT 1, PRIMARY KEY (id) ); SELECT setval('topics_id_seq', 100); diff --git a/activerecord/test/reflection_test.rb b/activerecord/test/reflection_test.rb index a892fb4acb..1658408d7a 100644 --- a/activerecord/test/reflection_test.rb +++ b/activerecord/test/reflection_test.rb @@ -22,6 +22,11 @@ class ReflectionTest < Test::Unit::TestCase assert_equal 12, Topic.columns.length end + def test_columns_are_returned_in_the_order_they_were_declared + column_names = Topic.columns.map { |column| column.name } + assert_equal %w(id title author_name author_email_address written_on bonus_time last_read content approved replies_count parent_id type), column_names + end + def test_content_columns assert_equal 8, Topic.content_columns.length end |