aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-12-27 01:50:03 +0530
committerPratik Naik <pratiknaik@gmail.com>2009-12-27 01:50:03 +0530
commitcc753eaf589b6dfae92f6fc0031c5710e616a26c (patch)
tree8811c30923080f33fbcd3234e3ac7ed8bd22ca7f /activerecord/test/cases
parentfeb7382047bf5e354edd12aa89895ec4591a5614 (diff)
downloadrails-cc753eaf589b6dfae92f6fc0031c5710e616a26c.tar.gz
rails-cc753eaf589b6dfae92f6fc0031c5710e616a26c.tar.bz2
rails-cc753eaf589b6dfae92f6fc0031c5710e616a26c.zip
Replace Model.first(options) with new finder methods inside tests
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/dirty_test.rb2
-rw-r--r--activerecord/test/cases/finder_test.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb
index f456d273fe..4961d12a44 100644
--- a/activerecord/test/cases/dirty_test.rb
+++ b/activerecord/test/cases/dirty_test.rb
@@ -301,7 +301,7 @@ class DirtyTest < ActiveRecord::TestCase
def test_save_should_not_save_serialized_attribute_with_partial_updates_if_not_present
with_partial_updates(Topic) do
Topic.create!(:author_name => 'Bill', :content => {:a => "a"})
- topic = Topic.first(:select => 'id, author_name')
+ topic = Topic.select('id, author_name').first
topic.update_attribute :author_name, 'John'
topic = Topic.first
assert_not_nil topic.content
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb
index 57ce0eee61..efc850cffc 100644
--- a/activerecord/test/cases/finder_test.rb
+++ b/activerecord/test/cases/finder_test.rb
@@ -233,11 +233,11 @@ class FinderTest < ActiveRecord::TestCase
end
def test_first
- assert_equal topics(:second).title, Topic.first(:conditions => "title = 'The Second Topic of the day'").title
+ assert_equal topics(:second).title, Topic.where("title = 'The Second Topic of the day'").first.title
end
def test_first_failing
- assert_nil Topic.first(:conditions => "title = 'The Second Topic of the day!'")
+ assert_nil Topic.where("title = 'The Second Topic of the day!'").first
end
def test_unexisting_record_exception_handling