@domcleal, yes, @obj.environment_id should have a value, in this case,  the id of fixture environments(:global_puppetmaster). I'm confused.