summaryrefslogtreecommitdiffstats
path: root/web/web_test.go
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-09-11 10:43:33 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-09-11 10:44:17 -0400
commit3edb4247e96bc4e203200a4cafe42bfcf0661299 (patch)
treed5c60eae9bd2584aa9189cf0b07a9932e574ca5b /web/web_test.go
parent9b22cf31f1de925ff7905bba5b302c4f5bc08000 (diff)
downloadchat-3edb4247e96bc4e203200a4cafe42bfcf0661299.tar.gz
chat-3edb4247e96bc4e203200a4cafe42bfcf0661299.tar.bz2
chat-3edb4247e96bc4e203200a4cafe42bfcf0661299.zip
PLT-198 Added a small delay to one of the web tests to allow the server to get fully set up
Diffstat (limited to 'web/web_test.go')
-rw-r--r--web/web_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/web/web_test.go b/web/web_test.go
index ff37b74d5..ccd0bba56 100644
--- a/web/web_test.go
+++ b/web/web_test.go
@@ -36,9 +36,14 @@ func TearDown() {
func TestStatic(t *testing.T) {
Setup()
- resp, _ := http.Get(URL + "/static/images/favicon.ico")
+ // add a short delay to make sure the server is ready to receive requests
+ time.Sleep(1 * time.Second)
- if resp.StatusCode != http.StatusOK {
+ resp, err := http.Get(URL + "/static/images/favicon.ico")
+
+ if err != nil {
+ t.Fatalf("got error while trying to get static files %v", err)
+ } else if resp.StatusCode != http.StatusOK {
t.Fatalf("couldn't get static files %v", resp.StatusCode)
}
}