mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-21 13:23:03 +01:00
test(api): add test theme not found
This commit is contained in:
@@ -32,6 +32,14 @@ func TestStartDynamic(t *testing.T) {
|
|||||||
assert.Equal(t, http.StatusBadRequest, r.Code)
|
assert.Equal(t, http.StatusBadRequest, r.Code)
|
||||||
assert.Equal(t, rfc7807.JSONMediaType, r.Header().Get("Content-Type"))
|
assert.Equal(t, rfc7807.JSONMediaType, r.Header().Get("Content-Type"))
|
||||||
})
|
})
|
||||||
|
t.Run("StartDynamicThemeNotFound", func(t *testing.T) {
|
||||||
|
app, router, strategy, m := NewApiTest(t)
|
||||||
|
StartDynamic(router, strategy)
|
||||||
|
m.EXPECT().RequestSessionGroup("test", gomock.Any()).Return(&sessions.SessionState{}, nil)
|
||||||
|
r := PerformRequest(app, "GET", "/api/strategies/dynamic?group=test&theme=invalid")
|
||||||
|
assert.Equal(t, http.StatusNotFound, r.Code)
|
||||||
|
assert.Equal(t, rfc7807.JSONMediaType, r.Header().Get("Content-Type"))
|
||||||
|
})
|
||||||
t.Run("StartDynamicByNames", func(t *testing.T) {
|
t.Run("StartDynamicByNames", func(t *testing.T) {
|
||||||
app, router, strategy, m := NewApiTest(t)
|
app, router, strategy, m := NewApiTest(t)
|
||||||
StartDynamic(router, strategy)
|
StartDynamic(router, strategy)
|
||||||
|
|||||||
Reference in New Issue
Block a user