Skip to content

Commit

Permalink
Merge 8b02aa7 into 227589b
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Feb 15, 2014
2 parents 227589b + 8b02aa7 commit e728869
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
9 changes: 1 addition & 8 deletions lib/blacklight/catalog/search_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@ module Blacklight::Catalog::SearchContext
# own controller.
included do
helper_method :current_search_session, :search_session
before_filter :search_session, :history_session, :current_search_session
before_filter :current_search_session
end

protected

# sets up the session[:history] hash if it doesn't already exist.
# assigns all Search objects (that match the searches in session[:history]) to a variable @searches.
def history_session
session[:history] ||= []
@searches = searches_from_history # <- in BlacklightController
end

# sets up the session[:search] hash if it doesn't already exist
def search_session
session[:search] ||= {}
Expand Down
5 changes: 0 additions & 5 deletions spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ def assigns_response
before do
controller.stub(:get_search_results)
end
it "should include :search key with hash" do
get :index
expect(session[:search]).to_not be_nil
expect(session[:search]).to be_kind_of(Hash)
end
it "should include search hash with key :q" do
get :index, :q => @user_query
expect(session[:search]).to_not be_nil
Expand Down

0 comments on commit e728869

Please sign in to comment.