mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 04:12:26 -06:00
[bugfix] Return empty result rather than 500 error when searching for blocked domains (#1498)
* [bugfix] Return empty result when searching for blocked domains * add tests
This commit is contained in:
parent
561ad71e58
commit
6c6f042290
2 changed files with 46 additions and 0 deletions
|
|
@ -252,6 +252,34 @@ func (suite *SearchGetTestSuite) TestSearchStatusByURL() {
|
|||
suite.NotNil(gotStatus)
|
||||
}
|
||||
|
||||
func (suite *SearchGetTestSuite) TestSearchBlockedDomainURL() {
|
||||
query := "https://replyguys.com/@someone"
|
||||
resolve := true
|
||||
|
||||
searchResult, err := suite.testSearch(query, resolve, http.StatusOK)
|
||||
if err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
||||
suite.Len(searchResult.Accounts, 0)
|
||||
suite.Len(searchResult.Statuses, 0)
|
||||
suite.Len(searchResult.Hashtags, 0)
|
||||
}
|
||||
|
||||
func (suite *SearchGetTestSuite) TestSearchBlockedDomainNamestring() {
|
||||
query := "@someone@replyguys.com"
|
||||
resolve := true
|
||||
|
||||
searchResult, err := suite.testSearch(query, resolve, http.StatusOK)
|
||||
if err != nil {
|
||||
suite.FailNow(err.Error())
|
||||
}
|
||||
|
||||
suite.Len(searchResult.Accounts, 0)
|
||||
suite.Len(searchResult.Statuses, 0)
|
||||
suite.Len(searchResult.Hashtags, 0)
|
||||
}
|
||||
|
||||
func TestSearchGetTestSuite(t *testing.T) {
|
||||
suite.Run(t, &SearchGetTestSuite{})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue