middleware testing spec