File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,18 @@ export default ApplicationAdapter.extend({
5
5
return this . ajax ( this . urlForFollowAction ( id ) , 'PUT' ) ;
6
6
} ,
7
7
8
- inviteOwner ( id , username ) {
9
- return this . ajax ( this . urlForOwnerAction ( id ) , 'PUT' , {
8
+ async inviteOwner ( id , username ) {
9
+ let result = await this . ajax ( this . urlForOwnerAction ( id ) , 'PUT' , {
10
10
data : {
11
11
owners : [ username ] ,
12
12
} ,
13
13
} ) ;
14
+
15
+ if ( result . ok ) {
16
+ return result ;
17
+ } else {
18
+ throw result ;
19
+ }
14
20
} ,
15
21
16
22
removeOwner ( id , username ) {
Original file line number Diff line number Diff line change @@ -281,7 +281,9 @@ module('Acceptance | crate page', function (hooks) {
281
281
await fillIn ( 'input[name="username"]' , 'spookyghostboo' ) ;
282
282
await click ( '[data-test-save-button]' ) ;
283
283
284
- assert . dom ( '[data-test-error-message]' ) . hasText ( 'Error sending invite: Not Found' ) ;
284
+ assert
285
+ . dom ( '[data-test-error-message]' )
286
+ . hasText ( 'Error sending invite: could not find user with login `spookyghostboo`' ) ;
285
287
assert . dom ( '[data-test-owners] [data-test-owner-team]' ) . exists ( { count : 2 } ) ;
286
288
assert . dom ( '[data-test-owners] [data-test-owner-user]' ) . exists ( { count : 2 } ) ;
287
289
} ) ;
You can’t perform that action at this time.
0 commit comments