Class: ImmutableAttributesTest
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- ImmutableAttributesTest
- Defined in:
- test/immutable_attributes_test.rb
Instance Method Summary collapse
Instance Method Details
#test_immutable_attribute_can_be_set ⇒ Object
23 24 25 |
# File 'test/immutable_attributes_test.rb', line 23 def test_immutable_attribute_can_be_set assert Record.new(:name => 'record name') end |
#test_immutable_attribute_cannot_be_changed ⇒ Object
27 28 29 30 |
# File 'test/immutable_attributes_test.rb', line 27 def test_immutable_attribute_cannot_be_changed record = Record.create!(:name => 'record name') assert_raises(ActiveRecord::ImmutableAttributeError) { record.update_attributes(:name => 'new name') } end |