Calendar view just like google calender with the week view only implemented

I have a timetable or a calendar that I am creating using javascript. I am creating values for each cell.

Where the user clicks a cell, there is a popup where the user enters a value and then clicks send to send the timetable in json format to the rails app.

Is there a way to add testing to this where inside the tests the json is created for me instead of me creating the timetable manually each time?