diff options
Diffstat (limited to 'activemodel/test/cases')
-rw-r--r-- | activemodel/test/cases/attribute_assignment_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activemodel/test/cases/attribute_assignment_test.rb b/activemodel/test/cases/attribute_assignment_test.rb index 448f8587fd..b06291f1b4 100644 --- a/activemodel/test/cases/attribute_assignment_test.rb +++ b/activemodel/test/cases/attribute_assignment_test.rb @@ -68,6 +68,14 @@ class AttributeAssignmentTest < ActiveModel::TestCase assert_equal "world", model.description end + test "simple assignment alias" do + model = Model.new + + model.attributes = { name: "hello", description: "world" } + assert_equal "hello", model.name + assert_equal "world", model.description + end + test "assign non-existing attribute" do model = Model.new error = assert_raises(ActiveModel::UnknownAttributeError) do |