it depends on the contract, most employers want you to work at least a year before taking maternity leave. So check contract before starting job otherwise you will be sacked