I have one test class which is working fine in one sandbox but same test class is getting failed in other sandbox. Below method is not working in Sandbox which may be cause of error.
Error: pageReference = standardController.delete();
static testMethod void deleteCaseForOtherTest() {
User u1 = CCC_TestCommonHelper.createUserForTurkey('Agent', Global_Constants.PROFILE_CC_AGENT);
User u2 = CCC_TestCommonHelper.createUserForTurkey('Manag', Global_Constants.PROFILE_CC_MANAGER);
Case c;
List<Case> cases;
System.runAs(u1) {
c = new Case(
RecordTypeId = RecordTypeHelper.CASE_RECORD_TYPES.get('Complaints'),
Status = 'Test_Status',
Sub_Status__c = 'Test_Substatus',
OwnerId = UserInfo.getUserId(),
Description = 'Test_Description'
);
insert c;
}
System.runAs(u2) {
// START Testing
ApexPages.StandardController standardController = new ApexPages.StandardController(c);
Global_CaseDeleteController testController = new Global_CaseDeleteController(standardController);
testController.checkDelete();
cases = [SELECT id FROM Case WHERE id = :c.id];
System.assertEquals(0, cases.size());
// END Testing
}
}