diff options
author | 2019-01-03 13:55:15 -0800 | |
---|---|---|
committer | 2019-01-03 13:55:15 -0800 | |
commit | 2bf0f688f895aa19f976051e30b967a6187e27b4 (patch) | |
tree | 6e3425e59eafaf05546e348bd2182a08a7fbe0f0 /handler_test.go | |
parent | a3b25c3f7761b0c8d4cd3871e335a32a929f8dda (diff) | |
download | sally-2bf0f688f895aa19f976051e30b967a6187e27b4.tar.gz sally-2bf0f688f895aa19f976051e30b967a6187e27b4.tar.zst sally-2bf0f688f895aa19f976051e30b967a6187e27b4.zip |
template: Bundle in binary with bindata (#36)
This uses go-bindata/go-bindata to bundle the template in the binary.
I also realized that the handler test was now broken because we were
checking the exact contents of the index page in the test. This change
fixes that too.
Diffstat (limited to 'handler_test.go')
-rw-r--r-- | handler_test.go | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/handler_test.go b/handler_test.go index ce5e290..ab8cd67 100644 --- a/handler_test.go +++ b/handler_test.go @@ -1,6 +1,10 @@ package main -import "testing" +import ( + "testing" + + "github.com/stretchr/testify/assert" +) var config = ` @@ -15,17 +19,11 @@ packages: func TestIndex(t *testing.T) { rr := CallAndRecord(t, config, "/") - AssertResponse(t, rr, 200, ` -<!DOCTYPE html> -<html> - <body> - <ul> - <li>thriftrw - github.com/thriftrw/thriftrw-go</li> - <li>yarpc - github.com/yarpc/yarpc-go</li> - </ul> - </body> -</html> -`) + assert.Equal(t, 200, rr.Code) + + body := rr.Body.String() + assert.Contains(t, body, "github.com/thriftrw/thriftrw-go") + assert.Contains(t, body, "github.com/yarpc/yarpc-go") } func TestPackageShouldExist(t *testing.T) { |