Migrate from koa-route to koa-router

This commit is contained in:
Jonathan Cremin 2015-08-22 16:16:15 +01:00
parent 8474cca94c
commit a4bf3dd51d
17 changed files with 206 additions and 291 deletions

View file

@ -1,6 +1,6 @@
import assert from 'assert';
import { agent } from 'supertest';
import app from '../../api/app';
import app from '../../app';
const request = agent(app.listen());
@ -9,7 +9,7 @@ describe('hostr-api user', function() {
describe('when GET /user', function() {
it('should receive a user object', function(done) {
request
.get('/user')
.get('/api/user')
.auth('test@hostr.co', 'test-password')
.expect(function(response) {
assert(response.body.id === '54fd04a37675bcd06213eac8');
@ -22,7 +22,7 @@ describe('hostr-api user', function() {
describe('when GET /user/token', function() {
it('should receive a user token object', function(done) {
request
.get('/user/token')
.get('/api/user/token')
.auth('test@hostr.co', 'test-password')
.expect(function(response) {
assert(response.body.token);
@ -35,7 +35,7 @@ describe('hostr-api user', function() {
describe('when GET /user/transaction', function() {
it('should receive a user transactions object', function(done) {
request
.get('/user/transaction')
.get('/api/user/transaction')
.auth('test@hostr.co', 'test-password')
.expect(200)
.expect(function(response) {
@ -48,7 +48,7 @@ describe('hostr-api user', function() {
describe('when GET /user/settings', function() {
it('should update user password', function(done) {
request
.post('/user/settings')
.post('/api/user/settings')
.send({'current_password': 'test-password', 'new_password': 'test-password' })
.auth('test@hostr.co', 'test-password')
.expect(200)