I can get the trigger (before update) to update the record accurately in the scenario I'm testing. But, I can't get this test to pass. Any help would be greatly appreciated.
@isTest
private class OpportunityTest2 {
static testMethod void myWinTriggerTest() {
// Create an account with an opportunity,
Account acct = new Account(Name='Test Account',
CreatedDate = System.today().addDays(-3),
First_Order_Date__c=System.today());
insert acct;
Opportunity opp = new Opportunity(Name='Test Opportunity',
StageName='Qualified',
CloseDate=System.today().addMonths(2),
AccountId=acct.Id);
insert opp;
test.startTest();
opp.Ready_to_Close__c = true;
update opp;
test.stopTest();
System.assert(opp.IsWon);
System.assertEquals('Closed Won', opp.StageName);
}
}