Spaces in Answer

I am writing a batch file and I want to do this:

set /p line=test : 
if %test% == answer with spaces goto correct
if not %test% == answer with spaces (
echo Wrong
pause >nul
exit
)
:correct
echo answer with spaces
echo it works!
pause >nul
exit

But it doesn't work, any help with that?