'use strict';
var Q = require('q'),
    game = require('../game'),
    Board = require('../board/board'),
    next_open_player = require('../player/next_open'),
    scorer = require('../scorer');

describe('game', function() {
    it('plays a game with two players', function(done) {
        var player_x = next_open_player,
            player_o = next_open_player,
            board = new Board();

        var promise = game.play(board, player_x, player_o);

        promise.then(
            function() {
                expect(scorer.winner(board)).toBe('x');
                expect(board.horizontal_rows()).toContain(['x', 'o', 'x']);
                expect(board.horizontal_rows()).toContain(['o', 'x', 'o']);
                expect(board.horizontal_rows()).toContain(['x', undefined, undefined]);
                done();
            },
            function(error) {
                expect('reject').toBe('not happening');
                done();
            }
        );
    });

    it('prompts x for a cell on an empty board', function(done) {
        var mockPlayer = function() {
            return {
                play: jasmine.createSpy().andCallFake(function(board) {
                    return Q.resolve(board.empty_cells()[0]);
                })
            };
        };
        var player_x = mockPlayer(),
            player_o = mockPlayer(),
            board = new Board();

        var promise = game.get_play(board, player_x, player_o);

        promise.then(
            function(choice) {
                expect(player_x.play).toHaveBeenCalledWith(board);
                expect(choice).toBe(1);
                expect(player_o.play).not.toHaveBeenCalled();
                done();
            },
            function(error) {
                expect('reject').toBe('not happening');
                done();
            }
        );
    });
});

@@ -7,16 +7,46 @@
 trict';%0A
+require('promise-matchers');%0A%0A
 var Q = 
@@ -496,33 +496,52 @@
     
+expect(
 promise
+)
 .t
-hen(%0A           
+oHaveBeenResolvedWith(done,
  fun
@@ -542,36 +542,32 @@
 e, function() %7B%0A
-    
             expe
@@ -606,36 +606,32 @@
 ');%0A            
-    
 expect(board.hor
@@ -678,36 +678,32 @@
 %5D);%0A            
-   
- 
 expect(board.hor
@@ -742,28 +742,24 @@
 'x', 'o'%5D);%0A
-    
             
@@ -842,171 +842,9 @@
     
-        done();%0A            %7D,%0A            function(error) %7B%0A                expect('reject').toBe('not happening');%0A                done();%0A            %7D%0A        
+%7D
 );%0A 
@@ -1340,33 +1340,52 @@
     
+expect(
 promise
+)
 .t
-hen(%0A           
+oHaveBeenResolvedWith(done,
  fun
@@ -1396,28 +1396,24 @@
 n(choice) %7B%0A
-    
             
@@ -1471,28 +1471,24 @@
             
-    
 expect(choic
@@ -1503,36 +1503,32 @@
 1);%0A            
-  
-  
 expect(player_o.
@@ -1569,171 +1569,9 @@
     
-        done();%0A            %7D,%0A            function(error) %7B%0A                expect('reject').toBe('not happening');%0A                done();%0A            %7D%0A        
+%7D
 );%0A 

Use promise helper in game spec