The story of Tamar
Tamar married the oldest son of Judah. He soon died, and Tamar then married his brother Onan, as the Levirate Law demanded. But Onan refused to father the son of his deceased brother, and he spilled his semen on the ground. This angered the Lord, who struck him, too. Now Tamar had to wait for the youngest son. Judah sent her back to her father's house - under the pretense that it was only temporary, but he secretly pledged to never call her back.
After a while Tamar caught on to his deceit. The obligation to continue the house of Judah burdened her heavily, so she made a plan. She dressed up as a prostitute, and caught up with Judah on one of his travels. He did not recognise her, and slept with her. He promised to pay her, come spring, with a little goat and gave her his personal belongings as a downpayment.
When she later came to him, he could do nothing but to acknlowledge his mistake, and he was full of praise for her dutiful, dedicated and courageous act. She returned to his house and gave birth to twins.