Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replace Model.first(options) with new finder methods inside tests

  • Loading branch information...
commit cc753eaf589b6dfae92f6fc0031c5710e616a26c 1 parent feb7382
@lifo lifo authored
View
2  activerecord/test/cases/dirty_test.rb
@@ -301,7 +301,7 @@ def test_save_should_store_serialized_attributes_even_with_partial_updates
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
View
4 activerecord/test/cases/finder_test.rb
@@ -233,11 +233,11 @@ def test_find_first_failing
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
Please sign in to comment.
Something went wrong with that request. Please try again.