(t *testing.T)
| 178 | } |
| 179 | |
| 180 | func TestNotifierBuildsAbsoluteURLs(t *testing.T) { |
| 181 | n, store, _, smtpDone := newNotifier(t) |
| 182 | agent, msg := setupPendingMessage(t, store, "abs-url") |
| 183 | |
| 184 | if err := n.NotifyPendingApproval(context.Background(), msg, agent); err != nil { |
| 185 | t.Fatal(err) |
| 186 | } |
| 187 | data := smtpDone()[0].Data |
| 188 | if !strings.Contains(data, publicURL+"/v1/approve?t=") { |
| 189 | t.Errorf("approve URL should be absolute under %q, got:\n%s", publicURL, data) |
| 190 | } |
| 191 | if !strings.Contains(data, publicURL+"/dashboard/pending/") { |
| 192 | t.Errorf("dashboard URL should be absolute under %q", publicURL) |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | func TestNotifierRejectsMessageWithNilApprovalExpiresAt(t *testing.T) { |
| 197 | n, store, _, smtpDone := newNotifier(t) |
nothing calls this directly
no test coverage detected