Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changed test names and removed a test.
  • Loading branch information
CodyGramlich committed May 2, 2019
commit 4d3f0757333d718295a462d0440111bcf3901a7d
21 changes: 2 additions & 19 deletions test/user.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('User', function() {
return user.unfollow(userToFollow);
})

it('should attempt to follow yourself', function(done) {
it('should not list yourself as one of your followers', function(done) {
user.follow(userToFollow, assertSuccessful(done, function(err, resp) {
user._request('GET', `/user/following`, null, assertSuccessful(done, function(err, following) {
expect((following.some(user => user['login'] === userToFollow))).to.be.false();
Expand All @@ -104,24 +104,7 @@ describe('User', function() {
return user.follow(userToUnfollow);
})

it('should attempt to unfollow a user', function(done) {
user.unfollow(userToUnfollow, assertSuccessful(done, function(err, resp) {
user._request('GET', `/user/following`, null, assertSuccessful(done, function(err, following) {
expect((following.some(user => user['login'] === userToUnfollow))).to.be.false();
done();
}));
}));
});
})

describe('unfollowing yourself', function(done) {
const userToUnfollow = testUser.USERNAME;

before(function() {
return user.follow(userToUnfollow);
})

it('should attempt to unfollow yourself', function(done) {
it('should unfollow a user', function(done) {
user.unfollow(userToUnfollow, assertSuccessful(done, function(err, resp) {
user._request('GET', `/user/following`, null, assertSuccessful(done, function(err, following) {
expect((following.some(user => user['login'] === userToUnfollow))).to.be.false();
Expand Down