UNPKG

1.06 kBJavaScriptView Raw
1/**
2 * Module dependencies
3 */
4var util = require( './util' );
5var assert = require( 'assert' );
6
7/**
8 * site.follow
9 */
10describe( 'wpcom.site.follow', function() {
11 // Global instances
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} );