Skip to content

Commit 38c697c

Browse files
committed
#381: Added test for delete & thaw
1 parent 9ba9bfa commit 38c697c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

activejdbc/src/test/java/org/javalite/activejdbc/Defect381_UpdateModifiedOnlyTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,23 @@ public void isModifiedAfterFind() {
8484
the(prgFromDB).shouldNotBe("new");
8585
the(prgFromDB).shouldNotBe("modified");
8686
}
87+
88+
@Test
89+
public void isModifiedAfterDeletaAndThaw() {
90+
Programmer prg = Programmer.createIt("first_name", "John", "last_name", "Doe");
91+
the(prg).shouldNotBe("new");
92+
the(prg).shouldNotBe("modified");
93+
prg.delete();
94+
the(prg).shouldBe("frozen");
95+
the(prg).shouldNotBe("modified");
96+
97+
prg.thaw();
98+
the(prg).shouldBe("new");
99+
the(prg).shouldBe("modified");
100+
the(prg.getDirtyAttributes()).shouldBeEqual(prg.getAttributes().keySet());
101+
102+
prg.saveIt();
103+
the(prg).shouldNotBe("new");
104+
the(prg).shouldNotBe("modified");
105+
}
87106
}

0 commit comments

Comments
 (0)