@@ -9,11 +9,33 @@ import codecheck.github.models.SearchRepositoryResult
9
9
class SearchOpSpec extends FunSpec
10
10
with Constants
11
11
{
12
- val input = SearchInput ( " tetris " ,sort = Some ( SearchSort .stars),order = SortDirection .desc)
13
- describe(" searchRepositories" ) {
12
+
13
+ describe(" searchRepositories" ) {
14
14
it(" with valid SearchInput should succeed" ) {
15
+ var q = " tetris language:assembly"
16
+ val q1 = q.trim.replaceAll(" " ," +" );
17
+ val input = SearchInput (q1,sort= Some (SearchSort .stars),order= SortDirection .desc)
18
+ Await .result(api.searchRepositories(input), TIMEOUT ).map { res =>
19
+ assert(res.total_count >= 1 )
20
+ assert(res.items(0 ).id >= 1 )
21
+ assert(res.items(0 ).name.length >= 1 )
22
+ assert(res.items(0 ).full_name.length >= 1 )
23
+ assert(res.items(0 ).description.isDefined)
24
+ assert(res.items(0 ).open_issues_count >= 0 )
25
+ println(" RESULT" + res)
26
+ }
27
+ }
28
+ it(" with valid changed query(q) SearchInput should succeed" ) {
29
+ var q = " jquery in:name,description"
30
+ val q1 = q.trim.replaceAll(" " ," +" );
31
+ val input = SearchInput (q1,sort= Some (SearchSort .stars),order= SortDirection .desc)
15
32
Await .result(api.searchRepositories(input), TIMEOUT ).map { res =>
16
33
assert(res.total_count >= 1 )
34
+ assert(res.items(0 ).id >= 1 )
35
+ assert(res.items(0 ).name.length >= 1 )
36
+ assert(res.items(0 ).full_name.length >= 1 )
37
+ assert(res.items(0 ).description.isDefined)
38
+ assert(res.items(0 ).open_issues_count >= 0 )
17
39
println(" RESULT" + res)
18
40
}
19
41
}
0 commit comments