Skip to content

Commit

Permalink
database: add tests for getting service by alias
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgooz committed Nov 23, 2018
1 parent 17ca72e commit 8bd44fe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions database/service_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,19 @@ func TestServiceDBGet(t *testing.T) {
require.True(t, IsErrNotFound(err))
}

func TestServiceDBGetWithAlias(t *testing.T) {
db, closer := openServiceDB(t)
defer closer()

want := &service.Service{ID: "1", Alias: "2", Name: "test-service"}
require.NoError(t, db.Save(want))
defer db.Delete(want.ID)

got, err := db.Get(want.Alias)
require.NoError(t, err)
require.Equal(t, want, got)
}

func TestServiceDBDelete(t *testing.T) {
db, closer := openServiceDB(t)
defer closer()
Expand Down

0 comments on commit 8bd44fe

Please sign in to comment.