diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2015-02-25 15:14:43 +0100 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2015-02-26 15:40:03 +0100 |
commit | 95c2fc967987e5dffa89a32c81bca736c7ba964d (patch) | |
tree | fb9607d98d956beb4037b2575de1b529f94107a9 /activemodel/test/cases | |
parent | 803ef74f9bbcbc71af12060157a996f7b65e24db (diff) | |
download | rails-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 'activemodel/test/cases')
-rw-r--r-- | activemodel/test/cases/attribute_assignment_test.rb | 4 | ||||
-rw-r--r-- | activemodel/test/cases/model_test.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/test/cases/attribute_assignment_test.rb b/activemodel/test/cases/attribute_assignment_test.rb index 402caf21f7..64a85e01eb 100644 --- a/activemodel/test/cases/attribute_assignment_test.rb +++ b/activemodel/test/cases/attribute_assignment_test.rb @@ -49,7 +49,7 @@ class AttributeAssignmentTest < ActiveModel::TestCase test "assign non-existing attribute" do model = Model.new - error = assert_raises(ActiveModel::AttributeAssignment::UnknownAttributeError) do + error = assert_raises(ActiveModel::UnknownAttributeError) do model.assign_attributes(hz: 1) end @@ -59,7 +59,7 @@ class AttributeAssignmentTest < ActiveModel::TestCase test "assign private attribute" do model = Model.new - assert_raises(ActiveModel::AttributeAssignment::UnknownAttributeError) do + assert_raises(ActiveModel::UnknownAttributeError) do model.assign_attributes(metadata: { a: 1 }) end end diff --git a/activemodel/test/cases/model_test.rb b/activemodel/test/cases/model_test.rb index 9a8d873ec9..3017f3541b 100644 --- a/activemodel/test/cases/model_test.rb +++ b/activemodel/test/cases/model_test.rb @@ -70,7 +70,7 @@ class ModelTest < ActiveModel::TestCase end def test_mixin_initializer_when_args_dont_exist - assert_raises(ActiveModel::AttributeAssignment::UnknownAttributeError) do + assert_raises(ActiveModel::UnknownAttributeError) do SimpleModel.new(hello: 'world') end end |