gondole_test.go
author Mikael Berthe <mikael@lilotux.net>
Sun, 16 Apr 2017 20:52:52 +0200
changeset 129 0d4544ce7e5e
parent 128 a5a00fad7a32
permissions -rw-r--r--
login: improve error message It looks like the server returns HTML when the authentication fails :/

package gondole

import (
	"testing"

	"github.com/sendgrid/rest"
	"github.com/stretchr/testify/assert"
)

func TestPrepareRequest(t *testing.T) {
	g := &Client{
		Name:    "foo",
		ID:      "666",
		Secret:  "biiiip",
		APIBase: "http://example.com",
	}

	req, err := g.prepareRequest("bar", rest.Get, nil)
	assert.NoError(t, err, "no error")
	assert.NotNil(t, req.Headers, "not nil")
}