Sha256: cf2a62f22b1874f1618486149605ddb7fc07f1b9f73040115f6bcb50e5e678fd
Contents?: true
Size: 701 Bytes
Versions: 9
Compression:
Stored size: 701 Bytes
Contents
require_relative "test_helper" class ReadonlyWhenArchivedTest < ActiveSupport::TestCase test "acts_as_archival objects can normally be altered after archive" do archival = Archival.create!(:name => "original") archival.archive archival.name = "updated" archival.save! assert_equal "updated", archival.reload.name end test "acts_as_archival marked as readonly_when_archived cannot be updated after archive" do archival = ReadonlyWhenArchived.create!(:name => "original") archival.archive archival.name = "updated" assert_not archival.save assert_equal "Cannot modify an archived record.", archival.errors.full_messages.first end end
Version data entries
9 entries across 9 versions & 1 rubygems