Skip to content
Permalink
Browse files

add test for expectedURL

  • Loading branch information...
rybit committed May 16, 2019
1 parent c77438b commit 61d0bfb108f475296e114f31968c06a933c67c76
Showing with 17 additions and 0 deletions.
  1. +17 −0 mailer/mailer_test.go
@@ -29,3 +29,20 @@ func TestGetSiteURL(t *testing.T) {
assert.Equal(t, c.Expected, act)
}
}

func TestRelativeURL(t *testing.T) {
cases := []struct {
URL string
Expected string
}{
{"https://test.example.com", ""},
{"http://test.example.com", ""},
{"test.example.com", "test.example.com"},
{"/some/path#fragment", "/some/path#fragment"},
}

for _, c := range cases {
res := enforceRelativeURL(c.URL)
assert.Equal(t, c.Expected, res, c.URL)
}
}

0 comments on commit 61d0bfb

Please sign in to comment.
You can’t perform that action at this time.