Commit c3668be95ad890dbf6ee8e5fd730d53d636810bf
1 parent
5ad505de
Exists in
master
and in
28 other branches
ActionItem237: workaround for ambiguity between liblocale-ruby1.8 and
libgettext-ruby1.8 in Debian. git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1580 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
3 changed files
with
3 additions
and
3 deletions
Show diff stats
app/helpers/search_helper.rb
... | ... | @@ -12,6 +12,6 @@ module SearchHelper |
12 | 12 | end |
13 | 13 | |
14 | 14 | def remove_stop_words(query) |
15 | - (query.downcase.scan(/"[^"]*"?|'[^']*'?|[^'"\s]+/) - STOP_WORDS[Locale.current.to_s]).join(' ') | |
15 | + (query.downcase.scan(/"[^"]*"?|'[^']*'?|[^'"\s]+/) - (STOP_WORDS[locale] || [])).join(' ') | |
16 | 16 | end |
17 | 17 | end | ... | ... |
config/environment.rb
test/functional/search_controller_test.rb
... | ... | @@ -21,7 +21,7 @@ class SearchControllerTest < Test::Unit::TestCase |
21 | 21 | end |
22 | 22 | |
23 | 23 | should 'filter stop words' do |
24 | - GetText.locale = 'pt_BR' | |
24 | + @controller.expects(:locale).returns('pt_BR').at_least_once | |
25 | 25 | get 'index', :query => 'a carne da vaca' |
26 | 26 | assert_response :success |
27 | 27 | assert_template 'index' | ... | ... |