tests for wroting json