aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/attribute_methods_test.rb
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2015-02-25 15:14:43 +0100
committerRobin Dupret <robin.dupret@gmail.com>2015-02-26 15:40:03 +0100
commit95c2fc967987e5dffa89a32c81bca736c7ba964d (patch)
treefb9607d98d956beb4037b2575de1b529f94107a9 /activerecord/test/cases/attribute_methods_test.rb
parent803ef74f9bbcbc71af12060157a996f7b65e24db (diff)
downloadrails-95c2fc967987e5dffa89a32c81bca736c7ba964d.tar.gz
rails-95c2fc967987e5dffa89a32c81bca736c7ba964d.tar.bz2
rails-95c2fc967987e5dffa89a32c81bca736c7ba964d.zip
Follow-up to #10776
The name `ActiveModel::AttributeAssignment::UnknownAttributeError` is too implementation specific so let's move the constant directly under the ActiveModel namespace. Also since this constant used to be under the ActiveRecord namespace, to make the upgrade path easier, let's avoid raising the former constant when we deal with this error on the Active Record side.
Diffstat (limited to 'activerecord/test/cases/attribute_methods_test.rb')
-rw-r--r--activerecord/test/cases/attribute_methods_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index 243c90e945..ea2b94cbf4 100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
@@ -758,12 +758,12 @@ class AttributeMethodsTest < ActiveRecord::TestCase
def test_bulk_update_respects_access_control
privatize("title=(value)")
- assert_raise(ActiveModel::AttributeAssignment::UnknownAttributeError) { @target.new(:title => "Rants about pants") }
- assert_raise(ActiveModel::AttributeAssignment::UnknownAttributeError) { @target.new.attributes = { :title => "Ants in pants" } }
+ assert_raise(ActiveRecord::UnknownAttributeError) { @target.new(:title => "Rants about pants") }
+ assert_raise(ActiveRecord::UnknownAttributeError) { @target.new.attributes = { :title => "Ants in pants" } }
end
def test_bulk_update_raise_unknown_attribute_error
- error = assert_raises(ActiveModel::AttributeAssignment::UnknownAttributeError) {
+ error = assert_raises(ActiveRecord::UnknownAttributeError) {
Topic.new(hello: "world")
}
assert_instance_of Topic, error.record