-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RHINENG-14351: add tests for system authenticated API for templates
- Loading branch information
1 parent
57c4d57
commit 50deccd
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
manager/controllers/template_subscribed_systems_update_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package controllers | ||
|
||
import ( | ||
"app/base/core" | ||
"app/base/database" | ||
"app/base/utils" | ||
"net/http/httptest" | ||
"testing" | ||
|
||
"github.com/gin-gonic/gin" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
var subscriptionUUID = "cccccccc-0000-0000-0001-000000000004" | ||
var templateSystemUUID = "00000000-0000-0000-0000-000000000004" | ||
|
||
func TestSubscribedSystemID(t *testing.T) { | ||
core.SetupTest(t) | ||
|
||
c, _ := gin.CreateTestContext(httptest.NewRecorder()) | ||
c.Set(utils.KeyAccount, templateAccount) | ||
c.Set(utils.KeySystem, subscriptionUUID) | ||
account, systemID, err := getSubscribedSystem(c, database.DB) | ||
|
||
assert.Nil(t, err) | ||
assert.Equal(t, templateAccount, account) | ||
assert.Equal(t, templateSystemUUID, systemID) | ||
} |