Spain beat 2006 World Cup finalists France 1-0 in Malaga thanks to a late goal from left back Joan Capdevila in another high profile dress rehearsal for the June tournament.