diff --git a/packages/play-node-go/server/data/seeds/06_move.js b/packages/play-node-go/server/data/seeds/06_move.js new file mode 100644 index 0000000..567ebd7 --- /dev/null +++ b/packages/play-node-go/server/data/seeds/06_move.js @@ -0,0 +1,14 @@ + +exports.seed = function(knex) { + // Deletes ALL existing entries + return knex('move').del() + .then(function () { + // Inserts seed entries + return knex('move').insert([ + {id: 1, player: 'black', point_x: 3, point_y: 3, number: 1, game_record: true, game: 1, prior_move: null}, + {id: 2, player: 'white', point_x: 15, point_y: 15, number: 2, game_record: true, game: 1, prior_move: 1}, + {id: 3, player: 'black', point_x: 4, point_y: 15, number: 3, game_record: true, game: 1, prior_move: 2}, + {id: 4, player: 'white', point_x: 15, point_y: 4, number: 4, game_record: true, game: 1, prior_move: 3}, + ]); + }); +}; diff --git a/packages/play-node-go/server/test/api.game.spec.js b/packages/play-node-go/server/test/api.game.spec.js index df0c09d..37c0282 100644 --- a/packages/play-node-go/server/test/api.game.spec.js +++ b/packages/play-node-go/server/test/api.game.spec.js @@ -31,7 +31,46 @@ const apiRoomSpec = (chai, knex, server) => { } const recordOne = [ - // {} + { + game: 1, + game_record: true, + id: 1, + number: 1, + player: "black", + point_x: 3, + point_y: 3, + prior_move: null + }, + { + game: 1, + game_record: true, + id: 2, + number: 2, + player: "white", + point_x: 15, + point_y: 15, + prior_move: 1 + }, + { + game: 1, + game_record: true, + id: 3, + number: 3, + player: "black", + point_x: 4, + point_y: 15, + prior_move: 2, + }, + { + game: 1, + game_record: true, + id: 4, + number: 4, + player: "white", + point_x: 15, + point_y: 4, + prior_move: 3, + } ] it('request to api games/1 should return 1 room game information with moves', done => {