Commit 2220fe167d588fa1ca900dcef497a875c22b989c
1 parent
6409d6cc
Exists in
master
and in
29 other branches
Fixing method with new solr search
(ActionItem1958)
Showing
2 changed files
with
2 additions
and
1 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
@@ -291,7 +291,7 @@ class CmsController < MyProfileController | @@ -291,7 +291,7 @@ class CmsController < MyProfileController | ||
291 | 291 | ||
292 | def search | 292 | def search |
293 | query = params[:q] | 293 | query = params[:q] |
294 | - results = query.blank? ? [] : profile.articles.published.find_by_contents(query) | 294 | + results = query.blank? ? [] : profile.articles.published.find_by_contents(query)[:results] |
295 | render :text => article_list_to_json(results), :content_type => 'application/json' | 295 | render :text => article_list_to_json(results), :content_type => 'application/json' |
296 | end | 296 | end |
297 | def media_upload | 297 | def media_upload |
test/functional/cms_controller_test.rb
@@ -9,6 +9,7 @@ class CmsControllerTest < Test::Unit::TestCase | @@ -9,6 +9,7 @@ class CmsControllerTest < Test::Unit::TestCase | ||
9 | fixtures :environments | 9 | fixtures :environments |
10 | 10 | ||
11 | def setup | 11 | def setup |
12 | + Test::Unit::TestCase::setup | ||
12 | @controller = CmsController.new | 13 | @controller = CmsController.new |
13 | @request = ActionController::TestRequest.new | 14 | @request = ActionController::TestRequest.new |
14 | @request.stubs(:ssl?).returns(true) | 15 | @request.stubs(:ssl?).returns(true) |