summaryrefslogtreecommitdiff
path: root/vendor/plugins/thinking-sphinx/features/deleting_instances.feature
blob: 7080a0b6c0b69642aecad25d05647ab780e6d4ac (plain)
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
Feature: Keeping Sphinx in line with deleted model instances
  In order to avoid deleted items being returned by Sphinx
  Thinking Sphinx
  Should keep deleted items out of search results
  
  Scenario: Deleting instances from the core index
    Given Sphinx is running
    And I am searching on betas
    When I search for three
    Then I should get 1 result
    
    When I destroy beta three
    And I wait for Sphinx to catch up
    And I search for three
    Then I should get 0 results
  
  Scenario: Deleting subclasses when the parent class is indexed
    Given Sphinx is running
    And I am searching on cats
    When I search for moggy
    Then I should get 1 result
    
    When I destroy cat moggy
    And I wait for Sphinx to catch up
    And I search for moggy
    Then I should get 0 results
  
  Scenario: Deleting created instances from the delta index
    Given Sphinx is running
    And I am searching on betas
    When I create a new beta named eleven
    And I wait for Sphinx to catch up
    And I search for eleven
    Then I should get 1 result
    
    When I destroy beta eleven
    And I wait for Sphinx to catch up
    And I search for eleven
    Then I should get 0 results
  
  Scenario: Deleting edited instances from the delta index
    Given Sphinx is running
    And I am searching on betas
    When I change the name of beta four to fourteen
    And I wait for Sphinx to catch up
    And I search for fourteen
    Then I should get 1 result
    
    When I destroy beta fourteen
    And I wait for Sphinx to catch up
    And I search for fourteen
    Then I should get 0 results