Skip to content

Commit

Permalink
Fixes tests for backpack controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
davelester committed Apr 13, 2013
1 parent 1284fbf commit 409f3f3
Showing 1 changed file with 21 additions and 75 deletions.
96 changes: 21 additions & 75 deletions test/backpack-controller.test.js
Expand Up @@ -81,32 +81,14 @@ $.prepareDatabase({
})
});
});
});

test('backpack#facebookSharing', function (t) {
conmock({
handler: backpack.facebookSharing,
request: {
body: {
accessToken: 'aaBBccDDeFgHiJkLMnOP',
badgeBodyHash: 'sillybadgehash',
userId: 'me',
comment: 'Commenting on my badge so others know how awesome I am!',
facebookAutomaticPush: 'checked'
}
}
}, function (err, mock, req) {
if (err) throw err;
t.equal(mock.status, 303);
t.end();
});
});

test('backpack#manage', function (t) {
// #TODO: re-write after making backpack.manage sane.
t.end();
});


test('backpack#settings redirects to login if no user', function (t) {
conmock({handler: backpack.settings()}, function(err, mock) {
t.same(mock.status, 303);
Expand Down Expand Up @@ -164,62 +146,26 @@ test('backpack#facebookSharing', function (t) {
});
t.end();
});
});
});

test('backpack#facebookSharing', function (t) {
conmock({
handler: backpack.facebookSharing,
request: {
body: {
accessToken: 'aaBBccDDeFgHiJkLMnOP',
badgeBodyHash: 'sillybadgehash',
userId: 'me',
comment: 'Commenting on my badge so others know how awesome I am!',
facebookAutomaticPush: 'checked'
}
}
}, function (err, mock, req) {
if (err) throw err;
t.equal(mock.status, 303);
t.end();
});
});

test('backpack#facebookSharing', function (t) {
conmock({
handler: backpack.facebookSharing,
request: {
body: {
accessToken: 'aaBBccDDeFgHiJkLMnOP',
badgeBodyHash: 'sillybadgehash',
userId: 'me',
comment: 'Commenting on my badge so others know how awesome I am!',
facebookAutomaticPush: 'checked'
}
}
}, function (err, mock, req) {
if (err) throw err;
t.equal(mock.status, 303);
t.end();
});
});
$.finish(test);
});

test('backpack#facebookSharing', function (t) {
conmock({
handler: backpack.facebookSharing,
request: {
body: {
accessToken: 'aaBBccDDeFgHiJkLMnOP',
badgeBodyHash: 'sillybadgehash',
userId: 'me',
comment: 'Commenting on my badge so others know how awesome I am!',
fbAutomaticPush: 'checked'
}
}
}, function (err, mock, req) {
if (err) throw err;
t.equal(mock.status, 303);
t.end();
test('backpack#facebookSharing', function (t) {
conmock({
handler: backpack.facebookSharing,
request: {
body: {
accessToken: 'aaBBccDDeFgHiJkLMnOP',
badgeBodyHash: 'sillybadgehash',
userId: 'me',
comment: 'Commenting on my badge so others know how awesome I am!',
facebookAutomaticPush: 'checked'
}
}
}, function (err, mock, req) {
if (err) throw err;
t.equal(mock.status, 303);
t.end();
});
});
});
});

0 comments on commit 409f3f3

Please sign in to comment.