diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-11 16:09:34 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-11 16:09:34 -0800 |
commit | 634424665422bc885c5e3f168908ea58e1f3c811 (patch) | |
tree | d9b42c9e23af077299d00fef11e552fe75da236d /activerecord/test/cases | |
parent | ca938c0fc90d28032005356b019db0d04b5439ee (diff) | |
download | rails-634424665422bc885c5e3f168908ea58e1f3c811.tar.gz rails-634424665422bc885c5e3f168908ea58e1f3c811.tar.bz2 rails-634424665422bc885c5e3f168908ea58e1f3c811.zip |
create_fixtures() should always return a list
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 6dbdf4ca54..ee51692f93 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -35,7 +35,7 @@ class FixturesTest < ActiveRecord::TestCase def test_clean_fixtures FIXTURES.each do |name| fixtures = nil - assert_nothing_raised { fixtures = create_fixtures(name) } + assert_nothing_raised { fixtures = create_fixtures(name).first } assert_kind_of(Fixtures, fixtures) fixtures.each { |_name, fixture| fixture.each { |key, value| @@ -53,7 +53,7 @@ class FixturesTest < ActiveRecord::TestCase end def test_attributes - topics = create_fixtures("topics") + topics = create_fixtures("topics").first assert_equal("The First Topic", topics["first"]["title"]) assert_nil(topics["second"]["author_email_address"]) end @@ -127,7 +127,7 @@ class FixturesTest < ActiveRecord::TestCase end def test_instantiation - topics = create_fixtures("topics") + topics = create_fixtures("topics").first assert_kind_of Topic, topics["first"].find end @@ -245,7 +245,7 @@ if Account.connection.respond_to?(:reset_pk_sequence!) def test_create_fixtures_resets_sequences_when_not_cached @instances.each do |instance| - max_id = create_fixtures(instance.class.table_name).fixtures.inject(0) do |_max_id, (_, fixture)| + max_id = create_fixtures(instance.class.table_name).first.fixtures.inject(0) do |_max_id, (_, fixture)| fixture_id = fixture['id'].to_i fixture_id > _max_id ? fixture_id : _max_id end @@ -509,7 +509,7 @@ class FasterFixturesTest < ActiveRecord::TestCase fixtures :categories, :authors def load_extra_fixture(name) - fixture = create_fixtures(name) + fixture = create_fixtures(name).first assert fixture.is_a?(Fixtures) @loaded_fixtures[fixture.table_name] = fixture end |