aboutsummaryrefslogtreecommitdiffstats
path: root/timetask/http_test.go
blob: 36f9e4ad1fbe7a626ad9b23822b542053e0ac936 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package timetask

import (
	"flag"
	"io/ioutil"
	"strings"
	"testing"
)

var username, password string

func init() {
	flag.StringVar(&username, "username", "", "Username")
	flag.StringVar(&password, "password", "", "Password")
	flag.Parse()

}

func TestLogin(t *testing.T) {
	t.Skip("No requests")

	response, _, err := Login(username, password)
	if err != nil {
		t.Fatal(err)
	}

	defer response.Body.Close()
	body, err := ioutil.ReadAll(response.Body)
	if err != nil {
		t.Fatal(err)
	}

	if !strings.Contains(string(body), "here is your time for the week") {
		t.Error("Login failed, got ", body)
	}
}