Skip to content

Commit

Permalink
Minor test changes
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Goddard <dave@goddard.id.au>
  • Loading branch information
ForestEckhardt authored and dgodd committed Aug 17, 2017
1 parent d1e6777 commit 95c22c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/staticfile/finalize/finalize.go
Expand Up @@ -171,7 +171,7 @@ func (sf *Finalizer) LoadStaticfile() error {

if !conf.HSTS && (conf.HSTSIncludeSubDomains || conf.HSTSPreload) {
sf.Log.Warning("http_strict_transport_security is not enabled while http_strict_transport_security_include_subdomains or http_strict_transport_security_preload have been enabled.")
sf.Log.Protip("http_strict_transport_security_include_subdomains and http_strict_transport_security_preload do nothing without http_strict_transport_security enabled. http://docs.cloudfoundry.org/buildpacks/staticfile/index.html#strict-security")
sf.Log.Protip("http_strict_transport_security_include_subdomains and http_strict_transport_security_preload do nothing without http_strict_transport_security enabled.", "http://docs.cloudfoundry.org/buildpacks/staticfile/index.html#strict-security")
}

authFile := filepath.Join(sf.BuildDir, "Staticfile.auth")
Expand Down
11 changes: 5 additions & 6 deletions src/staticfile/finalize/finalize_test.go
Expand Up @@ -247,18 +247,18 @@ var _ = Describe("Compile", func() {
})
})

Context("and sets http_strict_transport_security_include_subdomain", func() {
Context("and sets http_strict_transport_security_include_subdomains", func() {
BeforeEach(func() {
mockYaml.EXPECT().Load(filepath.Join(buildDir, "Staticfile"), gomock.Any()).Do(func(_ string, hash *map[string]string) {
(*hash)["http_strict_transport_security_include_subdomain"] = "true"
(*hash)["http_strict_transport_security_include_subdomains"] = "true"
})
})
It("sets http_strict_transport_security_include_subdomain", func() {
It("sets http_strict_transport_security_include_subdomains", func() {
Expect(finalizer.Config.HSTSIncludeSubDomains).To(Equal(true))
Expect(finalizer.Config.HSTS).To(Equal(false))
})
It("Logs", func() {
Expect(buffer.String()).To(Equal("-----> Enabling HSTS includeSubDomains\n"))
Expect(buffer.String()).To(ContainSubstring("-----> Enabling HSTS includeSubDomains\n"))
})
})

Expand All @@ -273,7 +273,7 @@ var _ = Describe("Compile", func() {
Expect(finalizer.Config.HSTS).To(Equal(false))
})
It("Logs", func() {
Expect(buffer.String()).To(Equal("-----> Enabling HSTS Preload\n"))
Expect(buffer.String()).To(ContainSubstring("-----> Enabling HSTS Preload\n"))
})
})

Expand Down Expand Up @@ -703,7 +703,6 @@ var _ = Describe("Compile", func() {
})
})


Context("force_https is set in staticfile", func() {
BeforeEach(func() {
staticfile.ForceHTTPS = true
Expand Down

0 comments on commit 95c22c3

Please sign in to comment.