There are many reasons you would leave your job. Not all of them are due to discontent or a better opportunity. Sometimes a spouse will get a job cross country causing you to follow, other times you might move laterally for a company you feel more passionate about working for. Either way, you hopefully a strong lead with another company, initial and follow-up interviews in the books before you have to leave.
The problem here is how you need to balance a few separate needs, wants, and protocols. You have your current workplace, your prospective employer, and yourself. You need to focus on your future while keeping in mind the professional and moral implications of spurning anyone in the process. Damage could occur when leading on a potential employer, taking on a project you won't complete at your current position, and being anything but candid on all fronts throughout the process. Your reputation is more important than your resume and integrity starts with your first job and follows throughout your career. If your current position or the one you are interviewing for is not the one you want, be honest. Even when you are looking for new work and need to find a job quickly, talk openly and ask for constructive input about what you do want. You could be surprised by the information and help you'll get from professionals who were once in your position.