Syntax error in script with if statement

I'm working on a function in a shell script I'm writing that will eventually take in and print out a list of vendor names and aliases (for my work) Here's the function in question:

addvendorandalias ()
{	 
echo
echo -n 'Would you like to create a new vendor list (y or n)? '
read answer
if [ answer='y' ] then
	echo 'Enter the name you would like to give the file: ' 
	read vendorfilename 	
	touch $vendorfilename 	
fi
echo 'Enter the vendorname: '
	read vendorname
}

when I try to run the script get this message:

-bash: vendorlist.txt: line 28: syntax error near unexpected token `fi'
-bash: vendorlist.txt: line 28: `fi'

I cannot for the life of me figure out what I've done wrong. According to the book I have I've constructed the if statement properly.

You have to put a semicolon after the "if test" if you put "then" on the same line. or you can break "then" to a new line without adding a semicolon.

At the same time answer should be used as $answer as below,

if [ $answer='y' ]; then

Hope this should work now!
Vasanth.

I don't think either will work (save for the ;, as stated)!

$ cat Scr1
unset answer
[ answer='y' ] && echo YeeHaa1
[ $answer='y' ] && echo YeeHaa2

$ ./Scr1
YeeHaa1
YeeHaa2

Spaces either side of =, and quoting the "$answer", not the 'y' would be more useful.