diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-11 10:18:17 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-11 10:18:17 +0100 |
commit | 4a1d5613008ecd36769019e622f061fae12d02fa (patch) | |
tree | 56ed0156896dd03cf937a44bde8d6c4d0c993662 | |
parent | e891547fc1b22843ddd5fa36895e6b3b85e3073e (diff) |
Always show tracking links even for things that currently have no results
-rw-r--r-- | app/views/general/search.rhtml | 3 | ||||
-rw-r--r-- | spec/controllers/general_controller_spec.rb | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index 90ace809e..a1f8c8f04 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -131,8 +131,7 @@ </p> <% end %> </div> <!-- header left --> - -<% if @track_thing && (@xapian_bodies_hits > 0 || @xapian_users_hits > 0 || @total_hits == 0)%> +<% if !@track_thing.nil? %> <div id="header_right"> <h2><%= _('Track this search')%></h2> <%= render :partial => 'track/tracking_links', :locals => { :track_thing => @track_thing, :own_request => false, :location => 'main' } %> diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index 81f4ed6d5..8a08ab7d0 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -215,5 +215,10 @@ describe GeneralController, "when searching" do assigns[:xapian_users].results.map{|x|x[:model]}.should == [u] end + it "should show tracking links for requests-only searches" do + get :search, :combined => ['"bob"', "requests"] + response.body.should include('Track this search') + end + end |