Skip to content

Commit

Permalink
Merge pull request #1717 from sarken/issue_4025
Browse files Browse the repository at this point in the history
4025 Autocomplete won't match words in quotes or parentheses
  • Loading branch information
CristinaRO committed Jun 21, 2014
2 parents 4acad52 + 4dc2888 commit 6cb8afd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions features/other/autocomplete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Scenario: Only matching canonical tags should appear in autocomplete, and search
And a set of tags for testing autocomplete
And I go to the new work page
Then the tag autocomplete fields should list only matching canonical tags
Then the tag autocomplete fields should list only matching canonical tags

Scenario: For fandom-specific autocomplete, if a fandom is entered then only characters/relationships within the fandom should appear in autocomplete
Given I am logged in
Expand Down Expand Up @@ -50,5 +49,3 @@ Scenario: Collection autocomplete shows Collection Title and Name
And I fill in "collection_names" with "Issue"
Then I should see "jb_fletcher" in the autocomplete
And I should see "robert_stack" in the autocomplete


2 changes: 1 addition & 1 deletion lib/autocomplete_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def autocomplete_cache_key(autocomplete_prefix, search_param)

def autocomplete_phrase_split(string)
# split into words
string.downcase.split(/(?:\s+|\&|\/)/) # split on spaces, slash, ampersand
string.downcase.split(/(?:\s+|\&|\/|"|\(|\))/) # split on one or more spaces, ampersand, slash, double quotation mark, opening parenthesis, closing parenthesis (just in case)
end

def autocomplete_pieces(string)
Expand Down

0 comments on commit 6cb8afd

Please sign in to comment.