feat: 按创建人隔离采集采购任务 (#127)
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"cmautobuy/admin/model"
|
||||
)
|
||||
|
||||
func listPostContext(t *testing.T, path string, values url.Values) (*gin.Context, *httptest.ResponseRecorder) {
|
||||
@@ -67,11 +69,12 @@ func Test列表写操作跳转保留筛选和页码(t *testing.T) {
|
||||
})
|
||||
t.Run("任务", func(t *testing.T) {
|
||||
context, recorder := listPostContext(t, "/tasks/delete", url.Values{
|
||||
"q": {"TASK"}, "type": {"collect"}, "status": {"pending"}, "page": {"2"},
|
||||
"q": {"TASK"}, "type": {"collect"}, "status": {"pending"}, "creator": {"buyer-a"}, "page": {"2"},
|
||||
})
|
||||
context.Set(currentUserKey, &model.User{Role: model.RoleAdmin})
|
||||
(&Handler{}).taskRedirect(context, "完成")
|
||||
assertRedirectQuery(t, recorder, "/tasks", map[string]string{
|
||||
"q": "TASK", "type": "collect", "status": "pending", "page": "2", "msg": "完成",
|
||||
"q": "TASK", "type": "collect", "status": "pending", "creator": "buyer-a", "page": "2", "msg": "完成",
|
||||
})
|
||||
})
|
||||
t.Run("客户端", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user