Goodness of fit tests for spatial Markov random fields