code.gitea.io/gitea@v1.22.3/tests/integration/explore_repos_test.go (about)

     1  // Copyright 2017 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package integration
     5  
     6  import (
     7  	"net/http"
     8  	"testing"
     9  
    10  	"code.gitea.io/gitea/tests"
    11  
    12  	"github.com/stretchr/testify/assert"
    13  )
    14  
    15  func TestExploreRepos(t *testing.T) {
    16  	defer tests.PrepareTestEnv(t)()
    17  
    18  	req := NewRequest(t, "GET", "/explore/repos?q=TheKeyword&topic=1&language=TheLang")
    19  	resp := MakeRequest(t, req, http.StatusOK)
    20  	respStr := resp.Body.String()
    21  
    22  	assert.Contains(t, respStr, `<input type="hidden" name="topic" value="true">`)
    23  	assert.Contains(t, respStr, `<input type="hidden" name="language" value="TheLang">`)
    24  	assert.Contains(t, respStr, `<input type="search" name="q" value="TheKeyword"`)
    25  }