diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-05 11:07:50 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-06 10:29:13 +0100 |
commit | f25d8a9e17fb65fa41dafdcbf0358853d68eaf45 (patch) | |
tree | fd8932fdf88b3774b5773866c5f8ceadea2cc15a /resource/testhelpers_test.go | |
parent | 54a89cde69c1fcda7afe0ba0f4e0de86f5f69aa5 (diff) |
Fix sub-folder baseURL handling for Page resources
I.e. images etc.
Fixes #4228
Diffstat (limited to 'resource/testhelpers_test.go')
-rw-r--r-- | resource/testhelpers_test.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/resource/testhelpers_test.go b/resource/testhelpers_test.go index 7ab210688..668885682 100644 --- a/resource/testhelpers_test.go +++ b/resource/testhelpers_test.go @@ -18,12 +18,17 @@ import ( ) func newTestResourceSpec(assert *require.Assertions) *Spec { + return newTestResourceSpecForBaseURL(assert, "https://example.com/") +} + +func newTestResourceSpecForBaseURL(assert *require.Assertions, baseURL string) *Spec { cfg := viper.New() - cfg.Set("baseURL", "https://example.com/") + cfg.Set("baseURL", baseURL) cfg.Set("resourceDir", "/res") fs := hugofs.NewMem(cfg) s, err := helpers.NewPathSpec(fs, cfg) + assert.NoError(err) spec, err := NewSpec(s, media.DefaultTypes) |