aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/fixtures_test.rb
diff options
context:
space:
mode:
authorrobertomiranda <rjmaltamar@gmail.com>2013-01-18 07:56:05 -0500
committerrobertomiranda <rjmaltamar@gmail.com>2013-01-18 07:56:05 -0500
commit7baecc48028e2d0cb57936ad10b9102ed129c9f9 (patch)
tree77e65e64c592e9f75cb849f851eb4dedb376c2e1 /activerecord/test/cases/fixtures_test.rb
parent4095c08729a188e6ebc24f86d60a10bc01053d9b (diff)
downloadrails-7baecc48028e2d0cb57936ad10b9102ed129c9f9.tar.gz
rails-7baecc48028e2d0cb57936ad10b9102ed129c9f9.tar.bz2
rails-7baecc48028e2d0cb57936ad10b9102ed129c9f9.zip
User Rails 4 find_by
Diffstat (limited to 'activerecord/test/cases/fixtures_test.rb')
-rw-r--r--activerecord/test/cases/fixtures_test.rb6
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