aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-07-25 22:43:21 -0300
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-07-25 22:43:21 -0300
commit17a64de4980683da3ca3c185205013a29a8cf88d (patch)
treea66cd1c7f0d651ed0a68c4b1bff106a9162ee754 /activerecord
parentdef9c85ffbdcf63e6c412b6bd4abafaa32ccdb5c (diff)
downloadrails-17a64de4980683da3ca3c185205013a29a8cf88d.tar.gz
rails-17a64de4980683da3ca3c185205013a29a8cf88d.tar.bz2
rails-17a64de4980683da3ca3c185205013a29a8cf88d.zip
Fix AR#update_columns tests on Ruby 1.8.7
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/persistence_test.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb
index 1cd35448e8..b66c9bf7ce 100644
--- a/activerecord/test/cases/persistence_test.rb
+++ b/activerecord/test/cases/persistence_test.rb
@@ -526,7 +526,7 @@ class PersistencesTest < ActiveRecord::TestCase
def test_update_columns
topic = Topic.find(1)
- topic.update_columns({ "approved" => true, title: "Sebastian Topic" })
+ topic.update_columns("approved" => true, :title => "Sebastian Topic")
assert topic.approved?
assert_equal "Sebastian Topic", topic.title
topic.reload
@@ -536,19 +536,19 @@ class PersistencesTest < ActiveRecord::TestCase
def test_update_columns_should_raise_exception_if_new_record
topic = Topic.new
- assert_raises(ActiveRecord::ActiveRecordError) { topic.update_columns({ approved: false }) }
+ assert_raises(ActiveRecord::ActiveRecordError) { topic.update_columns(:approved => false) }
end
def test_update_columns_should_not_leave_the_object_dirty
topic = Topic.find(1)
- topic.update_attributes({ "content" => "Have a nice day", :author_name => "Jose" })
+ topic.update_attributes("content" => "Have a nice day", :author_name => "Jose")
topic.reload
- topic.update_columns({ content: "You too", "author_name" => "Sebastian" })
+ topic.update_columns(:content => "You too", "author_name" => "Sebastian")
assert_equal [], topic.changed
topic.reload
- topic.update_columns({ content: "Have a nice day", author_name: "Jose" })
+ topic.update_columns(:content => "Have a nice day", :author_name => "Jose")
assert_equal [], topic.changed
end
@@ -556,7 +556,7 @@ class PersistencesTest < ActiveRecord::TestCase
minivan = Minivan.find('m1')
prev_color = minivan.color
prev_name = minivan.name
- assert_raises(ActiveRecord::ActiveRecordError) { minivan.update_columns({ name: "My old minivan", color: 'black' }) }
+ assert_raises(ActiveRecord::ActiveRecordError) { minivan.update_columns(:name => "My old minivan", :color => 'black') }
assert_equal prev_color, minivan.color
assert_equal prev_name, minivan.name
@@ -572,7 +572,7 @@ class PersistencesTest < ActiveRecord::TestCase
developer.update_column(:updated_at, prev_month)
assert_equal prev_month, developer.updated_at
- developer.update_columns({ salary: 80000 })
+ developer.update_columns(:salary => 80000)
assert_equal prev_month, developer.updated_at
assert_equal 80000, developer.salary