Skip to content

Commit

Permalink
Fix new version of sinon with codefix
Browse files Browse the repository at this point in the history
  • Loading branch information
JMPerez committed Feb 26, 2018
1 parent 1e64f25 commit 177b8f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/strategy.test.js
Expand Up @@ -113,7 +113,7 @@ describe('SpotifyStrategy', function() {

describe('on success', function() {
before(function() {
sinon.stub(strategy._oauth2, '_request', function(method, url, headers, post_body, access_token, callback) {
sinon.stub(strategy._oauth2, '_request').callsFake(function(method, url, headers, post_body, access_token, callback) {
headers.should.eql({
'Content-Type': 'application/x-www-form-urlencoded'
});
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('SpotifyStrategy', function() {

describe('on error', function() {
before(function() {
sinon.stub(strategy._oauth2, '_request', function(method, url, headers, post_body, access_token, callback) {
sinon.stub(strategy._oauth2, '_request').callsFake(function(method, url, headers, post_body, access_token, callback) {
headers.should.eql({
'Content-Type': 'application/x-www-form-urlencoded'
});
Expand All @@ -171,7 +171,7 @@ describe('SpotifyStrategy', function() {
describe('when told to load user profile', function() {
describe('on success', function() {
before(function() {
sinon.stub(strategy._oauth2, '_request', function(method, url, headers, post_body, access_token, callback) {
sinon.stub(strategy._oauth2, '_request').callsFake(function(method, url, headers, post_body, access_token, callback) {
headers.should.eql({'Authorization': 'Bearer something'});
var body = JSON.stringify({
'id': 'spotifier',
Expand Down Expand Up @@ -240,7 +240,7 @@ describe('SpotifyStrategy', function() {

describe('on incorrect JSON answer', function() {
before(function() {
sinon.stub(strategy._oauth2, '_request', function(method, url, headers, post_body, access_token, callback) {
sinon.stub(strategy._oauth2, '_request').callsFake(function(method, url, headers, post_body, access_token, callback) {
headers.should.eql({'Authorization': 'Bearer something'});
var body = 'I\'m not a JSON, really!';

Expand All @@ -257,7 +257,7 @@ describe('SpotifyStrategy', function() {

describe('on API GET error', function() {
before(function() {
sinon.stub(strategy._oauth2, '_request', function(method, url, headers, post_body, access_token, callback) {
sinon.stub(strategy._oauth2, '_request').callsFake(function(method, url, headers, post_body, access_token, callback) {
headers.should.eql({'Authorization': 'Bearer something'});
callback(new Error('something-went-wrong'));
});
Expand Down

0 comments on commit 177b8f8

Please sign in to comment.