aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/modules_test.rb
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-04-26 18:32:55 +0100
committerJon Leighton <j@jonathanleighton.com>2012-04-26 18:32:55 +0100
commit75f03eca753f1e835409a80db1f54f716ef48d18 (patch)
tree6ef084ea2ee7b44c574096274ab6d5fa7a308235 /activerecord/test/cases/modules_test.rb
parentb30996307d3b8d0d519c7ddcfa28fdeed428b602 (diff)
downloadrails-75f03eca753f1e835409a80db1f54f716ef48d18.tar.gz
rails-75f03eca753f1e835409a80db1f54f716ef48d18.tar.bz2
rails-75f03eca753f1e835409a80db1f54f716ef48d18.zip
remove calls to find(:first), find(:last) and find(:all)
Diffstat (limited to 'activerecord/test/cases/modules_test.rb')
-rw-r--r--activerecord/test/cases/modules_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/modules_test.rb b/activerecord/test/cases/modules_test.rb
index e0fdd2871c..aee8a42e91 100644
--- a/activerecord/test/cases/modules_test.rb
+++ b/activerecord/test/cases/modules_test.rb
@@ -27,13 +27,13 @@ class ModulesTest < ActiveRecord::TestCase
end
def test_module_spanning_associations
- firm = MyApplication::Business::Firm.find(:first)
+ firm = MyApplication::Business::Firm.first
assert !firm.clients.empty?, "Firm should have clients"
assert_nil firm.class.table_name.match('::'), "Firm shouldn't have the module appear in its table name"
end
def test_module_spanning_has_and_belongs_to_many_associations
- project = MyApplication::Business::Project.find(:first)
+ project = MyApplication::Business::Project.first
project.developers << MyApplication::Business::Developer.create("name" => "John")
assert_equal "John", project.developers.last.name
end
@@ -123,7 +123,7 @@ class ModulesTest < ActiveRecord::TestCase
old = ActiveRecord::Base.store_full_sti_class
ActiveRecord::Base.store_full_sti_class = true
- collection = Shop::Collection.find(:first)
+ collection = Shop::Collection.first
assert !collection.products.empty?, "Collection should have products"
assert_nothing_raised { collection.destroy }
ensure
@@ -134,7 +134,7 @@ class ModulesTest < ActiveRecord::TestCase
old = ActiveRecord::Base.store_full_sti_class
ActiveRecord::Base.store_full_sti_class = true
- product = Shop::Product.find(:first)
+ product = Shop::Product.first
assert !product.variants.empty?, "Product should have variants"
assert_nothing_raised { product.destroy }
ensure