diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-02-11 18:55:33 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-02-11 18:55:33 +0300 |
commit | 9bc5a5ff0b4bbbf8ef2fab821bc974909d276982 (patch) | |
tree | ae5ab90fa93a4de98fc23d86c7d7464b53647cdd /domains_test.go | |
parent | 78672a4f8a99a3fda63ccd9119f63639827617ab (diff) |
First bunch of tests
Diffstat (limited to 'domains_test.go')
-rw-r--r-- | domains_test.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/domains_test.go b/domains_test.go new file mode 100644 index 00000000..5c16aa14 --- /dev/null +++ b/domains_test.go @@ -0,0 +1,35 @@ +package main + +import ( + "testing" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/assert" +) + +func TestReadProjects(t *testing.T) { + *pagesDomain = "test.io" + + d := make(domains) + err := d.ReadGroups() + require.NoError(t, err) + + var domains []string + for domain, _ := range d { + domains = append(domains, domain) + } + + expectedDomains := []string{ + "group.test.io", + "group.internal.test.io", + "test.domain.com", // from config.json + "other.domain.com", + } + + for _, expected := range domains { + assert.Contains(t, domains, expected) + } + + for _, actual := range domains { + assert.Contains(t, expectedDomains, actual) + } +} |