madon_test.go
author Mikael Berthe <mikael@lilotux.net>
Thu, 06 Sep 2018 00:23:40 +0200
changeset 236 5b87cc73ed97
parent 138 23d3a518d0ad
permissions -rw-r--r--
Update search result type (us rich tag structure) This change will let us use the same 'Results' object for both versions of the search API endpoint (v1 & v2).

package madon

import (
	"testing"

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

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

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