@@ -70,40 +70,6 @@ describe('storage.FunctionBuilder', () => {
7070 expect ( ( ) => storage . bucket ( 'bad/bucket/format' ) ) . to . throw ( Error ) ;
7171 } ) ;
7272
73- it ( 'should correct nested media links using a single literal slash' , ( ) => {
74- let cloudFunction = storage . object ( ) . onChange ( ( event ) => {
75- return event . data . mediaLink ;
76- } ) ;
77- let badMediaLinkEvent = {
78- data : {
79- mediaLink : 'https://www.googleapis.com/storage/v1/b/mybucket.appspot.com'
80- + '/o/nestedfolder/myobject.file?generation=12345&alt=media' ,
81- } ,
82- } ;
83- return cloudFunction ( badMediaLinkEvent ) . then ( result => {
84- expect ( result ) . equals (
85- 'https://www.googleapis.com/storage/v1/b/mybucket.appspot.com'
86- + '/o/nestedfolder%2Fmyobject.file?generation=12345&alt=media' ) ;
87- } ) ;
88- } ) ;
89-
90- it ( 'should correct nested media links using multiple literal slashes' , ( ) => {
91- let cloudFunction = storage . object ( ) . onChange ( ( event ) => {
92- return event . data . mediaLink ;
93- } ) ;
94- let badMediaLinkEvent = {
95- data : {
96- mediaLink : 'https://www.googleapis.com/storage/v1/b/mybucket.appspot.com'
97- + '/o/nestedfolder/anotherfolder/myobject.file?generation=12345&alt=media' ,
98- } ,
99- } ;
100- return cloudFunction ( badMediaLinkEvent ) . then ( result => {
101- expect ( result ) . equals (
102- 'https://www.googleapis.com/storage/v1/b/mybucket.appspot.com'
103- + '/o/nestedfolder%2Fanotherfolder%2Fmyobject.file?generation=12345&alt=media' ) ;
104- } ) ;
105- } ) ;
106-
10773 it ( 'should not mess with media links using non-literal slashes' , ( ) => {
10874 let cloudFunction = storage . object ( ) . onChange ( ( event ) => {
10975 return event . data . mediaLink ;
0 commit comments