Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Darmody committed May 15, 2016
1 parent 6093249 commit d954f79
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions src/reducers/__tests__/auth.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Auth Actions', function actions() {
'captcha_solution=captcha',
'captcha_id=captchaId'
];
nock('http://douban.fm/')
nock('https://douban.fm/')
.post('/j/login', _.join('&', params))
.reply(200, {
user_info: {
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('Auth Actions', function actions() {
'captcha_solution=captcha',
'captcha_id=captchaId'
];
nock('http://douban.fm/')
nock('https://douban.fm/')
.post('/j/login', _.join('&', params))
.reply(200, { err_msg: 'wrong_password' });

Expand All @@ -78,7 +78,7 @@ describe('Auth Actions', function actions() {
});

it('VERIFY_SUCCESS', function verifySuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/user_info')
.reply(200, {
user_id: 1,
Expand All @@ -93,7 +93,7 @@ describe('Auth Actions', function actions() {
});

it('VERIFY_FAILURE', function verifyFailure(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/user_info')
.reply(200, { msg: 'need_permission' });

Expand Down Expand Up @@ -122,8 +122,8 @@ describe('Auth Reducers', function reducers() {
auth({ user: { id: 0 } }, { type: LOGIN_SUCCESS, payload: null })
).to.deep.equal({ user: { id: 0, name: '', token: '' }, logged: false });
expect(
signForm({ user: { id: 0 } }, { type: LOGIN_FAILURE, error: 'wrong_password' })._error
).to.equal('账号或密码不正确');
signForm({ user: { id: 0 } }, { type: LOGIN_FAILURE, error: '账号不能为空' })._error
).to.equal('账号不能为空');
});

it('VERIFY_SUCCESS', function verifySuccess() {
Expand Down
2 changes: 1 addition & 1 deletion src/reducers/__tests__/captcha.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Captcha Actions', function actions() {
});

it('FETCH_SUCCESS', function fetchSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/new_captcha')
.reply(200, 'code');

Expand Down
12 changes: 6 additions & 6 deletions src/reducers/__tests__/channel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Channel Actions', function actions() {
};

it('FETCH_SUCCESS', function fetchSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query(nockParams)
.reply(200, {
Expand Down Expand Up @@ -63,7 +63,7 @@ describe('Channel Actions', function actions() {
});

it('FETCH_REFUSED', function fetchRefused(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query(nockParams)
.reply(200, {
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('Channel Actions', function actions() {
});

it('LIKE_SUCCESS', function likeSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'r' })
.reply(200, {
Expand Down Expand Up @@ -127,7 +127,7 @@ describe('Channel Actions', function actions() {
});

it('DISLIKE_SUCCESS', function dislikeSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'u' })
.reply(200, {
Expand Down Expand Up @@ -157,7 +157,7 @@ describe('Channel Actions', function actions() {
});

it('BAN_SUCCESS', function banSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'b' })
.reply(200, {
Expand Down Expand Up @@ -189,7 +189,7 @@ describe('Channel Actions', function actions() {
});

it('BAN_REFUSED', function banRefused(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'b' })
.reply(200, {
Expand Down
10 changes: 5 additions & 5 deletions src/reducers/__tests__/daily.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Daily Actions', function actions() {
};

it('FETCH_SUCCESS', function fetchSuccess(done) {
nock('http://douban.fm')
nock('https://douban.fm')
.get('/j/v2/songlist/user_daily?kbs=192')
.reply(200, {
songs: [{
Expand Down Expand Up @@ -60,7 +60,7 @@ describe('Daily Actions', function actions() {
});

it('LIKE_SUCCESS', function likeSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'r' })
.reply(200, {
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('Daily Actions', function actions() {
});

it('DISLIKE_SUCCESS', function dislikeSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'u' })
.reply(200, {
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('Daily Actions', function actions() {
});

it('BAN_SUCCESS', function banSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'b' })
.reply(200, {
Expand Down Expand Up @@ -152,7 +152,7 @@ describe('Daily Actions', function actions() {
});

it('BAN_FAILURE', function banFailure(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'b' })
.reply(200, {
Expand Down
12 changes: 6 additions & 6 deletions src/reducers/__tests__/favorite.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Favorite Actions', function actions() {
};

it('FETCH_ALL_SUCCESS', function fetchSuccess(done) {
nock('http://douban.fm')
nock('https://douban.fm')
.get('/j/v2/redheart/basic')
.reply(200, {
songs: [{
Expand All @@ -44,7 +44,7 @@ describe('Favorite Actions', function actions() {
favorite: 1,
}]
});
nock('http://douban.fm')
nock('https://douban.fm')
.post('/j/v2/redheart/songs', _.join('&', ['bps=192', 'sids=1', 'ck=']))
.reply(200, [{
sid: 1,
Expand All @@ -71,7 +71,7 @@ describe('Favorite Actions', function actions() {
});

it('LIKE_SUCCESS', function likeSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'r' })
.reply(200, {
Expand Down Expand Up @@ -101,7 +101,7 @@ describe('Favorite Actions', function actions() {
});

it('DISLIKE_SUCCESS', function dislikeSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'u' })
.reply(200, {
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('Favorite Actions', function actions() {
});

it('BAN_SUCCESS', function banSuccess(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'b' })
.reply(200, {
Expand Down Expand Up @@ -163,7 +163,7 @@ describe('Favorite Actions', function actions() {
});

it('BAN_FAILURE', function banFailure(done) {
nock('http://douban.fm/')
nock('https://douban.fm/')
.get('/j/v2/playlist')
.query({ ...nockParams, type: 'b' })
.reply(200, {
Expand Down

0 comments on commit d954f79

Please sign in to comment.