-
Notifications
You must be signed in to change notification settings - Fork 14
/
form_test.go
49 lines (40 loc) · 1.12 KB
/
form_test.go
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
37
38
39
40
41
42
43
44
45
46
47
48
49
package gohubspot
import (
"testing"
"time"
)
func TestFormService_SubmitForm(t *testing.T) {
setup()
defer teardown()
testportal := 62515
formId := "1cdf3a0e-fbc1-4bae-8c88-e2b77b28d3b1"
var now UnixTime
now.Time = time.Now().UTC()
f := testclient.Forms.
AddOption("firstname", "John").
AddOption("lastname", "Sur").
AddOption("email", "[email protected]").
AddOption("free_trial_start_date", (&now).String()).
// SetHubspotCookie("4f4aa9cc70c4f821af05ccf164c638ba").
// SetRemoteIpAddress("239.59.167.65:443").
SetPageUrl("https://google.com").
SetPageName("Registration")
err := f.SubmitForm(testportal, formId)
if err != nil {
t.Error(err)
}
f = testclient.Forms.
AddOption("firstname", "John").
AddOption("lastname", "Sur").
AddOption("email", "[email protected]").
AddOption("free_trial_start_date", (&now).String()).
// SetHubspotCookie("4f4aa9cc70c4f821af05ccf164c638ba").
// SetRemoteIpAddress("239.59.167.65:443").
SetPageUrl("https://google.com").
SetPageName("Registration")
err = f.SubmitForm(testportal, formId)
if err != nil {
t.Error(err)
}
t.Error("just error")
}