Problem using a variable in a selector

Problem using a variable in a selector

hello 
Any idea why this works 

  $("#test a:first[rel*='modal']").css("background-color", "red")

and this does not!!!

var testing='modal';
$("#test a:first[rel*=testing]").css("background-color", "red");