@@ -47,9 +47,12 @@ describe('POST /instances/:id/actions/copy', { timeout: 500 }, function () {
4747 shortHash : exists ,
4848 name : exists ,
4949 public : exists ,
50- createdBy : { github : ctx . user . json ( ) . accounts . github . id } ,
50+ createdBy : { github : ctx . user . json ( ) . accounts . github . id ,
51+ username : ctx . user . json ( ) . accounts . github . username ,
52+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
5153 owner : { github : ctx . user . json ( ) . accounts . github . id ,
52- username : ctx . user . json ( ) . accounts . github . username } ,
54+ username : ctx . user . json ( ) . accounts . github . username ,
55+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
5356 parent : ctx . instance . id ( ) ,
5457 'build._id' : ctx . build . id ( ) ,
5558 containers : exists
@@ -62,9 +65,12 @@ describe('POST /instances/:id/actions/copy', { timeout: 500 }, function () {
6265 shortHash : exists ,
6366 name : 'new-name-fo-shizzle' ,
6467 public : exists ,
65- createdBy : { github : ctx . user . json ( ) . accounts . github . id } ,
66- 'owner.github' : ctx . user . json ( ) . accounts . github . id ,
67- 'owner.username' : ctx . user . json ( ) . accounts . github . username ,
68+ createdBy : { github : ctx . user . json ( ) . accounts . github . id ,
69+ username : ctx . user . json ( ) . accounts . github . username ,
70+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
71+ owner : { github : ctx . user . json ( ) . accounts . github . id ,
72+ username : ctx . user . json ( ) . accounts . github . username ,
73+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
6874 parent : ctx . instance . id ( ) ,
6975 'build._id' : ctx . build . id ( ) ,
7076 containers : exists
@@ -83,9 +89,12 @@ describe('POST /instances/:id/actions/copy', { timeout: 500 }, function () {
8389 shortHash : exists ,
8490 name : exists ,
8591 public : exists ,
86- createdBy : { github : ctx . user . json ( ) . accounts . github . id } ,
92+ createdBy : { github : ctx . user . json ( ) . accounts . github . id ,
93+ username : ctx . user . json ( ) . accounts . github . username ,
94+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
8795 owner : { github : ctx . user . json ( ) . accounts . github . id ,
88- username : ctx . user . json ( ) . accounts . github . username } ,
96+ username : ctx . user . json ( ) . accounts . github . username ,
97+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
8998 parent : ctx . instance . id ( ) ,
9099 'build._id' : ctx . build . id ( ) ,
91100 containers : exists ,
@@ -99,9 +108,12 @@ describe('POST /instances/:id/actions/copy', { timeout: 500 }, function () {
99108 shortHash : exists ,
100109 name : exists ,
101110 public : exists ,
102- createdBy : { github : ctx . user . json ( ) . accounts . github . id } ,
111+ createdBy : { github : ctx . user . json ( ) . accounts . github . id ,
112+ username : ctx . user . json ( ) . accounts . github . username ,
113+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
103114 owner : { github : ctx . user . json ( ) . accounts . github . id ,
104- username : ctx . user . json ( ) . accounts . github . username } ,
115+ username : ctx . user . json ( ) . accounts . github . username ,
116+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
105117 parent : ctx . instance . id ( ) ,
106118 'build._id' : ctx . build . id ( ) ,
107119 containers : exists ,
@@ -131,7 +143,9 @@ describe('POST /instances/:id/actions/copy', { timeout: 500 }, function () {
131143 shortHash : exists ,
132144 name : exists ,
133145 public : exists ,
134- createdBy : { github : ctx . user . json ( ) . accounts . github . id } ,
146+ createdBy : { github : ctx . user . json ( ) . accounts . github . id ,
147+ username : ctx . user . json ( ) . accounts . github . username ,
148+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
135149 'owner.github' : ctx . orgId ,
136150 parent : ctx . instance . id ( ) ,
137151 'build._id' : ctx . build . id ( ) ,
@@ -157,14 +171,17 @@ describe('POST /instances/:id/actions/copy', { timeout: 500 }, function () {
157171 require ( '../../fixtures/mocks/github/user-orgs' ) ( ctx . orgId , 'Runnable' ) ;
158172 require ( '../../fixtures/mocks/github/user-orgs' ) ( ctx . orgId , 'Runnable' ) ;
159173 require ( '../../fixtures/mocks/github/user-orgs' ) ( ctx . orgId , 'Runnable' ) ;
174+ require ( '../../fixtures/mocks/github/user' ) ( ctx . nonOwner ) ;
160175 ctx . otherInstance = ctx . user . copyInstance ( ctx . instance . id ( ) , done ) ;
161176 } ) ;
162177 it ( 'should copy the instance when part of the same org as the owner' , function ( done ) {
163178 var expected = {
164179 shortHash : exists ,
165180 name : exists ,
166181 public : exists ,
167- createdBy : { github : ctx . nonOwner . json ( ) . accounts . github . id } ,
182+ createdBy : { github : ctx . nonOwner . json ( ) . accounts . github . id ,
183+ username : ctx . nonOwner . json ( ) . accounts . github . username ,
184+ gravatar : ctx . nonOwner . json ( ) . accounts . github . avatar_url } ,
168185 'owner.github' : ctx . orgId ,
169186 parent : ctx . otherInstance . id ( ) ,
170187 'build._id' : ctx . build . id ( ) ,
@@ -198,9 +215,12 @@ describe('POST /instances/:id/actions/copy', { timeout: 500 }, function () {
198215 shortHash : exists ,
199216 name : exists ,
200217 public : exists ,
201- createdBy : { github : ctx . user . json ( ) . accounts . github . id } ,
218+ createdBy : { github : ctx . user . json ( ) . accounts . github . id ,
219+ username : ctx . user . json ( ) . accounts . github . username ,
220+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
202221 owner : { github : ctx . user . json ( ) . accounts . github . id ,
203- username : ctx . user . json ( ) . accounts . github . username } ,
222+ username : ctx . user . json ( ) . accounts . github . username ,
223+ gravatar : ctx . user . json ( ) . accounts . github . avatar_url } ,
204224 parent : ctx . instance . id ( ) ,
205225 'build._id' : ctx . build . id ( ) ,
206226 containers : exists
0 commit comments