1 |
|
2 |
|
3 |
|
4 | var util = require( './util' );
|
5 | var assert = require( 'assert' );
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | describe( 'wpcom.site.follow', function() {
|
11 |
|
12 | var wpcom = util.wpcom();
|
13 | var site = wpcom.site( util.site() );
|
14 | var follow = site.follow();
|
15 |
|
16 | describe( 'wpcom.site.follow.follow', function() {
|
17 | it( 'should follow site', done => {
|
18 | follow.follow()
|
19 | .then( data => {
|
20 | assert.ok( data );
|
21 | assert.equal( true, data.is_following );
|
22 |
|
23 | done();
|
24 | } )
|
25 | .catch( done );
|
26 | } );
|
27 | } );
|
28 |
|
29 | describe( 'wpcom.site.follow.unfollow', function() {
|
30 | it( 'should unfollow site', done => {
|
31 | follow.unfollow()
|
32 | .then( data => {
|
33 | assert.ok( data );
|
34 | assert.equal( false, data.is_following );
|
35 |
|
36 | done();
|
37 | } )
|
38 | .catch( done );
|
39 | } );
|
40 | } );
|
41 |
|
42 | describe( 'wpcom.site.follow.mine', function() {
|
43 | it( 'should get follow status', done => {
|
44 | follow.mine()
|
45 | .then( data => {
|
46 | assert.ok( data );
|
47 | assert.equal( false, data.is_following );
|
48 |
|
49 | done();
|
50 | } )
|
51 | .catch( done );
|
52 | } );
|
53 | } );
|
54 | } );
|