@@ -28,7 +28,7 @@ function dropDB(done) {
2828 } ) ;
2929}
3030
31- describe ( 'GET /api/getPosts ' , function ( ) {
31+ describe ( 'GET /api/posts ' , function ( ) {
3232
3333 beforeEach ( 'connect and add two post entries' , function ( done ) {
3434
@@ -49,7 +49,7 @@ describe('GET /api/getPosts', function () {
4949 it ( 'Should correctly give number of Posts' , function ( done ) {
5050
5151 request ( app )
52- . get ( '/api/getPosts ' )
52+ . get ( '/api/posts ' )
5353 . set ( 'Accept' , 'application/json' )
5454 . end ( function ( err , res ) {
5555 Post . find ( ) . exec ( function ( err , posts ) {
@@ -60,7 +60,7 @@ describe('GET /api/getPosts', function () {
6060 } ) ;
6161} ) ;
6262
63- describe ( 'GET /api/getPost ' , function ( ) {
63+ describe ( 'GET /api/posts/:slug ' , function ( ) {
6464
6565 beforeEach ( 'connect and add one Post entry' , function ( done ) {
6666
@@ -80,7 +80,7 @@ describe('GET /api/getPost', function () {
8080 it ( 'Should send correct data when queried against a title' , function ( done ) {
8181
8282 request ( app )
83- . get ( '/api/getPost?slug= bar-f34gb2bh24b24b2' )
83+ . get ( '/api/posts/ bar-f34gb2bh24b24b2' )
8484 . set ( 'Accept' , 'application/json' )
8585 . end ( function ( err , res ) {
8686 Post . findOne ( { cuid : 'f34gb2bh24b24b2' } ) . exec ( function ( err , post ) {
@@ -92,7 +92,7 @@ describe('GET /api/getPost', function () {
9292
9393} ) ;
9494
95- describe ( 'POST /api/addPost ' , function ( ) {
95+ describe ( 'POST /api/posts ' , function ( ) {
9696
9797 beforeEach ( 'connect and add a post' , function ( done ) {
9898
@@ -108,7 +108,7 @@ describe('POST /api/addPost', function () {
108108 it ( 'Should send correctly add a post' , function ( done ) {
109109
110110 request ( app )
111- . post ( '/api/addPost ' )
111+ . post ( '/api/posts ' )
112112 . send ( { post : { name : 'Foo' , title : 'bar' , content : 'Hello Mern says Foo' } } )
113113 . set ( 'Accept' , 'application/json' )
114114 . end ( function ( err , res ) {
@@ -121,7 +121,7 @@ describe('POST /api/addPost', function () {
121121
122122} ) ;
123123
124- describe ( 'POST /api/deletePost ' , function ( ) {
124+ describe ( 'POST /api/posts ' , function ( ) {
125125 var postId ;
126126
127127 beforeEach ( 'connect and add one Post entry' , function ( done ) {
@@ -148,8 +148,8 @@ describe('POST /api/deletePost', function () {
148148 } ) ;
149149
150150 request ( app )
151- . post ( '/api/deletePost ' )
152- . send ( { postId : postId } )
151+ . delete ( '/api/posts ' )
152+ . send ( { id : postId } )
153153 . set ( 'Accept' , 'application/json' )
154154 . end ( function ( ) {
155155
0 commit comments