aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/general/search.rhtml3
-rw-r--r--spec/controllers/general_controller_spec.rb5
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