aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/dup_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-03-22 21:04:32 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-03-22 21:04:32 -0700
commitea4e021dceea10ba1b98ac9b33e36cabf735ce82 (patch)
tree72974490c032f9a753f3fc41d335a049c8abbc05 /activerecord/test/cases/dup_test.rb
parentb714140f4df50d102e70b0151bbb3a09e470d61a (diff)
parentb332891b2ab4188e9d39737f4d214812afa3ce2c (diff)
downloadrails-ea4e021dceea10ba1b98ac9b33e36cabf735ce82.tar.gz
rails-ea4e021dceea10ba1b98ac9b33e36cabf735ce82.tar.bz2
rails-ea4e021dceea10ba1b98ac9b33e36cabf735ce82.zip
Merge pull request #5557 from carlosantoniodasilva/fix-build-3-2
Fix build for branch 3-2-stable
Diffstat (limited to 'activerecord/test/cases/dup_test.rb')
-rw-r--r--activerecord/test/cases/dup_test.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/activerecord/test/cases/dup_test.rb b/activerecord/test/cases/dup_test.rb
index 0236f9b0a1..303f616c61 100644
--- a/activerecord/test/cases/dup_test.rb
+++ b/activerecord/test/cases/dup_test.rb
@@ -10,14 +10,14 @@ module ActiveRecord
end
def test_not_readonly
- topic = Topic.first
+ topic = Topic.order(:id).first
duped = topic.dup
assert !duped.readonly?, 'should not be readonly'
end
def test_is_readonly
- topic = Topic.first
+ topic = Topic.order(:id).first
topic.readonly!
duped = topic.dup
@@ -25,7 +25,7 @@ module ActiveRecord
end
def test_dup_not_persisted
- topic = Topic.first
+ topic = Topic.order(:id).first
duped = topic.dup
assert !duped.persisted?, 'topic not persisted'
@@ -33,20 +33,20 @@ module ActiveRecord
end
def test_dup_has_no_id
- topic = Topic.first
+ topic = Topic.order(:id).first
duped = topic.dup
assert_nil duped.id
end
def test_dup_with_modified_attributes
- topic = Topic.first
+ topic = Topic.order(:id).first
topic.author_name = 'Aaron'
duped = topic.dup
assert_equal 'Aaron', duped.author_name
end
def test_dup_with_changes
- dbtopic = Topic.first
+ dbtopic = Topic.order(:id).first
topic = Topic.new
topic.attributes = dbtopic.attributes
@@ -61,7 +61,7 @@ module ActiveRecord
end
def test_dup_topics_are_independent
- topic = Topic.first
+ topic = Topic.order(:id).first
topic.author_name = 'Aaron'
duped = topic.dup
@@ -71,7 +71,7 @@ module ActiveRecord
end
def test_dup_attributes_are_independent
- topic = Topic.first
+ topic = Topic.order(:id).first
duped = topic.dup
duped.author_name = 'meow'
@@ -82,7 +82,7 @@ module ActiveRecord
end
def test_dup_timestamps_are_cleared
- topic = Topic.first
+ topic = Topic.order(:id).first
assert_not_nil topic.updated_at
assert_not_nil topic.created_at
@@ -98,6 +98,5 @@ module ActiveRecord
assert_not_nil new_topic.updated_at
assert_not_nil new_topic.created_at
end
-
end
end