forked from ryanb/xapit
/
finding.feature
111 lines (95 loc) · 3.15 KB
/
finding.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
Background:
Given an empty database at "tmp/xapiandatabase"
Scenario: Query Matching No Records
Given indexed records named "John, Jane"
When I query for "Sam"
Then I should find 0 records
Scenario: Query Matching One Record
Given indexed records named "John, Jane"
When I query for "John"
Then I should find record named "John"
Scenario: Query Matching Two Records
Given indexed records named "John Smith, Jane Smith, John Smithsonian"
When I query for "Smith"
Then I should find records named "John Smith, Jane Smith"
Scenario: Query Field Matching
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query "age" matching "17"
Then I should find records named "Jane, Jack"
Scenario: Query for Page 1
Given 3 indexed records
When I query page 1 at 2 per page
Then I should find 2 records
Scenario: Query for Page 2
Given 3 indexed records
When I query page 2 at 2 per page
Then I should find 1 record
And I should have 3 records total
Scenario: Query for All Records Class Agnostic
Given indexed records named "John, Jane"
When I query for "John" on Xapit
Then I should find 1 record
Scenario: Query Matching Or Query
Given indexed records named "John, Jane, Jacob"
When I query for "Jane OR John"
Then I should find records named "John, Jane"
Scenario: Query Matching Not Query
Given indexed records named "John Smith, John Johnson"
When I query for "John NOT Smith"
Then I should find records named "John Johnson"
Scenario: Unicode characters in search
Given indexed records named "über cool, uber hot"
When I query for "über"
Then I should find records named "über cool"
Scenario: Query Field Not Matching
Given the following indexed records
| name | age |
| John | 23 |
| Jane | 17 |
| Jack | 17 |
When I query "age" not matching "17"
Then I should find records named "John"
Scenario: Query Range of Integer
Given the following indexed records
| name | age |
| John | 8 |
| Jane | 13 |
| Jack | 24 |
When I query "age" between 8 and 15
Then I should find records named "John, Jane"
Scenario: Query Partial Match on Condition
Given the following indexed records
| name | sirname |
| John | Jacobson |
| Jane | Niel |
| Jack | Striker |
When I query "name" matching "Ja*"
Then I should find records named "Jane, Jack"
Scenario: Query no partial match on conditions with one letter
Given the following indexed records
| name | sirname |
| John | Jacobson |
| Jane | Niel |
| Jack | Striker |
When I query "name" matching " J*"
Then I should find 0 records
Scenario: Query partial match in keywords
Given the following indexed records
| name | sirname |
| John | Jacobson |
| Bill | Niel |
| Jack | Striker |
When I query for "Ja*"
Then I should find records named "John, Jack"
Scenario: Query no partial match in keywords with one letter
Given the following indexed records
| name | sirname |
| John | Jacobson |
| Bill | Niel |
| Jack | J |
When I query for " J*"
Then I should find records named "Jack"