diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-01-18 05:06:42 -0800 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-01-18 05:06:42 -0800 |
commit | 637a7d9d357a0f3f725b0548282ca8c5e7d4af4a (patch) | |
tree | d0b3307df008377ba4b0449866d45c1a66556991 /activerecord/test/cases/fixtures_test.rb | |
parent | 5937bd02dee112646469848d7fe8a8bfcef5b4c1 (diff) | |
parent | 7baecc48028e2d0cb57936ad10b9102ed129c9f9 (diff) | |
download | rails-637a7d9d357a0f3f725b0548282ca8c5e7d4af4a.tar.gz rails-637a7d9d357a0f3f725b0548282ca8c5e7d4af4a.tar.bz2 rails-637a7d9d357a0f3f725b0548282ca8c5e7d4af4a.zip |
Merge pull request #8989 from robertomiranda/use-rails-4-find-by
Replace deprecated find_by_* with find_by
Diffstat (limited to 'activerecord/test/cases/fixtures_test.rb')
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index b0b29f5f42..58f9f7e3b9 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -66,7 +66,7 @@ class FixturesTest < ActiveRecord::TestCase def test_create_fixtures fixtures = ActiveRecord::FixtureSet.create_fixtures(FIXTURES_ROOT, "parrots") - assert Parrot.find_by_name('Curious George'), 'George is not in the database' + assert Parrot.find_by(name: 'Curious George'), 'George is not in the database' assert fixtures.detect { |f| f.name == 'parrots' }, "no fixtures named 'parrots' in #{fixtures.map(&:name).inspect}" end @@ -80,7 +80,7 @@ class FixturesTest < ActiveRecord::TestCase def test_create_symbol_fixtures fixtures = ActiveRecord::FixtureSet.create_fixtures(FIXTURES_ROOT, :collections, :collections => Course) { Course.connection } - assert Course.find_by_name('Collection'), 'course is not in the database' + assert Course.find_by(name: 'Collection'), 'course is not in the database' assert fixtures.detect { |f| f.name == 'collections' }, "no fixtures named 'collections' in #{fixtures.map(&:name).inspect}" end @@ -738,7 +738,7 @@ class ActiveSupportSubclassWithFixturesTest < ActiveRecord::TestCase # This seemingly useless assertion catches a bug that caused the fixtures # setup code call nil[] def test_foo - assert_equal parrots(:louis), Parrot.find_by_name("King Louis") + assert_equal parrots(:louis), Parrot.find_by(name: "King Louis") end end |