@@ -128,55 +128,35 @@ describe('UrlUtils', function () {
128
128
fakeConfig . url = 'http://my-ghost-blog.com' ;
129
129
utils . urlFor ( testContext ) . should . equal ( '/' ) ;
130
130
utils . urlFor ( testContext , true ) . should . equal ( 'http://my-ghost-blog.com/' ) ;
131
- utils . urlFor ( testContext , { secure : true } , true ) . should . equal ( 'https://my-ghost-blog.com/' ) ;
132
131
133
132
fakeConfig . url = 'http://my-ghost-blog.com/' ;
134
133
utils . urlFor ( testContext ) . should . equal ( '/' ) ;
135
134
utils . urlFor ( testContext , true ) . should . equal ( 'http://my-ghost-blog.com/' ) ;
136
- utils . urlFor ( testContext , { secure : true } , true ) . should . equal ( 'https://my-ghost-blog.com/' ) ;
137
135
138
136
fakeConfig . url = 'http://my-ghost-blog.com/blog' ;
139
137
utils . urlFor ( testContext ) . should . equal ( '/blog/' ) ;
140
138
utils . urlFor ( testContext , true ) . should . equal ( 'http://my-ghost-blog.com/blog/' ) ;
141
- utils . urlFor ( testContext , { secure : true } , true ) . should . equal ( 'https://my-ghost-blog.com/blog/' ) ;
142
139
143
140
fakeConfig . url = 'http://my-ghost-blog.com/blog/' ;
144
141
utils . urlFor ( testContext ) . should . equal ( '/blog/' ) ;
145
142
utils . urlFor ( testContext , true ) . should . equal ( 'http://my-ghost-blog.com/blog/' ) ;
146
- utils . urlFor ( testContext , { secure : true } , true ) . should . equal ( 'https://my-ghost-blog.com/blog/' ) ;
147
143
148
144
// Output blog url without trailing slash
149
145
fakeConfig . url = 'http://my-ghost-blog.com' ;
150
146
utils . urlFor ( testContext ) . should . equal ( '/' ) ;
151
147
utils . urlFor ( testContext , true ) . should . equal ( 'http://my-ghost-blog.com/' ) ;
152
- utils . urlFor ( testContext , {
153
- secure : true ,
154
- trailingSlash : false
155
- } , true ) . should . equal ( 'https://my-ghost-blog.com' ) ;
156
148
157
149
fakeConfig . url = 'http://my-ghost-blog.com/' ;
158
150
utils . urlFor ( testContext ) . should . equal ( '/' ) ;
159
151
utils . urlFor ( testContext , true ) . should . equal ( 'http://my-ghost-blog.com/' ) ;
160
- utils . urlFor ( testContext , {
161
- secure : true ,
162
- trailingSlash : false
163
- } , true ) . should . equal ( 'https://my-ghost-blog.com' ) ;
164
152
165
153
fakeConfig . url = 'http://my-ghost-blog.com/blog' ;
166
154
utils . urlFor ( testContext ) . should . equal ( '/blog/' ) ;
167
155
utils . urlFor ( testContext , true ) . should . equal ( 'http://my-ghost-blog.com/blog/' ) ;
168
- utils . urlFor ( testContext , {
169
- secure : true ,
170
- trailingSlash : false
171
- } , true ) . should . equal ( 'https://my-ghost-blog.com/blog' ) ;
172
156
173
157
fakeConfig . url = 'http://my-ghost-blog.com/blog/' ;
174
158
utils . urlFor ( testContext ) . should . equal ( '/blog/' ) ;
175
159
utils . urlFor ( testContext , true ) . should . equal ( 'http://my-ghost-blog.com/blog/' ) ;
176
- utils . urlFor ( testContext , {
177
- secure : true ,
178
- trailingSlash : false
179
- } , true ) . should . equal ( 'https://my-ghost-blog.com/blog' ) ;
180
160
} ) ;
181
161
182
162
it ( 'should handle weird cases by always returning /' , function ( ) {
@@ -201,14 +181,6 @@ describe('UrlUtils', function () {
201
181
utils . urlFor ( testContext ) . should . equal ( '/blog/about/' ) ;
202
182
utils . urlFor ( testContext , true ) . should . equal ( 'http://my-ghost-blog.com/blog/about/' ) ;
203
183
204
- testContext . secure = true ;
205
- utils . urlFor ( testContext , true ) . should . equal ( 'https://my-ghost-blog.com/blog/about/' ) ;
206
-
207
- testContext . secure = false ;
208
- utils . urlFor ( testContext , true ) . should . equal ( 'http://my-ghost-blog.com/blog/about/' ) ;
209
-
210
- testContext . secure = false ;
211
-
212
184
fakeConfig . url = 'https://my-ghost-blog.com' ;
213
185
utils . urlFor ( testContext , true ) . should . equal ( 'https://my-ghost-blog.com/about/' ) ;
214
186
} ) ;
@@ -254,12 +226,6 @@ describe('UrlUtils', function () {
254
226
testData = { image : '/blog/static/images/my-image4.jpg' } ;
255
227
utils . urlFor ( testContext , testData ) . should . equal ( '/blog/static/images/my-image4.jpg' ) ;
256
228
utils . urlFor ( testContext , testData , true ) . should . equal ( 'http://my-ghost-blog.com/blog/static/images/my-image4.jpg' ) ;
257
-
258
- // Test case for blogs with optional https -
259
- // they may be configured with http url but the actual connection may be over https (#8373)
260
- fakeConfig . url = 'http://my-ghost-blog.com' ;
261
- testData = { image : '/static/images/my-image.jpg' , secure : true } ;
262
- utils . urlFor ( testContext , testData , true ) . should . equal ( 'https://my-ghost-blog.com/static/images/my-image.jpg' ) ;
263
229
} ) ;
264
230
265
231
it ( 'should return a url for a nav item when asked for it' , function ( ) {
@@ -272,9 +238,6 @@ describe('UrlUtils', function () {
272
238
testData = { nav : { url : 'http://my-ghost-blog.com/short-and-sweet/' } } ;
273
239
utils . urlFor ( testContext , testData ) . should . equal ( 'http://my-ghost-blog.com/short-and-sweet/' ) ;
274
240
275
- testData = { nav : { url : 'http://my-ghost-blog.com//short-and-sweet/' } , secure : true } ;
276
- utils . urlFor ( testContext , testData ) . should . equal ( 'https://my-ghost-blog.com/short-and-sweet/' ) ;
277
-
278
241
testData = { nav : { url : 'http://my-ghost-blog.com:3000/' } } ;
279
242
utils . urlFor ( testContext , testData ) . should . equal ( 'http://my-ghost-blog.com:3000/' ) ;
280
243
0 commit comments