@@ -5,15 +5,15 @@ import fetch from 'fetch';
5
5
import { setupTest } from '../../../helpers' ;
6
6
import setupMirage from '../../../helpers/setup-mirage' ;
7
7
8
- module ( 'Mirage | GET /api/v1/me /crate_owner_invitations' , function ( hooks ) {
8
+ module ( 'Mirage | GET /api/private /crate_owner_invitations' , function ( hooks ) {
9
9
setupTest ( hooks ) ;
10
10
setupMirage ( hooks ) ;
11
11
12
12
test ( 'empty case' , async function ( assert ) {
13
13
let user = this . server . create ( 'user' ) ;
14
14
this . server . create ( 'mirage-session' , { user } ) ;
15
15
16
- let response = await fetch ( '/api/v1/me /crate_owner_invitations' ) ;
16
+ let response = await fetch ( '/api/private /crate_owner_invitations' ) ;
17
17
assert . equal ( response . status , 200 ) ;
18
18
assert . deepEqual ( await response . json ( ) , { crate_owner_invitations : [ ] } ) ;
19
19
} ) ;
@@ -44,7 +44,7 @@ module('Mirage | GET /api/v1/me/crate_owner_invitations', function (hooks) {
44
44
inviter : inviter2 ,
45
45
} ) ;
46
46
47
- let response = await fetch ( '/api/v1/me /crate_owner_invitations' ) ;
47
+ let response = await fetch ( '/api/private /crate_owner_invitations' ) ;
48
48
assert . equal ( response . status , 200 ) ;
49
49
assert . deepEqual ( await response . json ( ) , {
50
50
crate_owner_invitations : [
@@ -55,6 +55,7 @@ module('Mirage | GET /api/v1/me/crate_owner_invitations', function (hooks) {
55
55
invited_by_username : 'janed' ,
56
56
invitee_id : Number ( user . id ) ,
57
57
inviter_id : Number ( inviter . id ) ,
58
+ expires_at : '2017-01-24T12:34:56Z' ,
58
59
} ,
59
60
{
60
61
crate_id : Number ( ember . id ) ,
@@ -63,6 +64,7 @@ module('Mirage | GET /api/v1/me/crate_owner_invitations', function (hooks) {
63
64
invited_by_username : 'wycats' ,
64
65
invitee_id : Number ( user . id ) ,
65
66
inviter_id : Number ( inviter2 . id ) ,
67
+ expires_at : '2017-01-31T12:34:56Z' ,
66
68
} ,
67
69
] ,
68
70
users : [
@@ -92,7 +94,7 @@ module('Mirage | GET /api/v1/me/crate_owner_invitations', function (hooks) {
92
94
} ) ;
93
95
94
96
test ( 'returns an error if unauthenticated' , async function ( assert ) {
95
- let response = await fetch ( '/api/v1/me /crate_owner_invitations' ) ;
97
+ let response = await fetch ( '/api/private /crate_owner_invitations' ) ;
96
98
assert . equal ( response . status , 403 ) ;
97
99
assert . deepEqual ( await response . json ( ) , {
98
100
errors : [ { detail : 'must be logged in to perform that action' } ] ,
0 commit comments