Skip to content

Commit

Permalink
Next/previous buttons should maintain the current search session
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Nov 4, 2015
1 parent b58dc6e commit b24e271
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/concerns/blacklight/catalog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def show
# updates the search counter (allows the show view to paginate)
def track
search_session['counter'] = params[:counter]
search_session['id'] = params[:search_id]
search_session['per_page'] = params[:per_page]

path = if params[:redirect] and (params[:redirect].starts_with?("/") or params[:redirect] =~ URI::regexp)
Expand Down
5 changes: 5 additions & 0 deletions spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def assigns_response

describe "track action" do
doc_id = '2007020969'

it "should persist the search session id value into session[:search]" do
put :track, :id => doc_id, :counter => 3, search_id: "123"
expect(session[:search]['id']).to eq "123"
end

it "should set counter value into session[:search]" do
put :track, :id => doc_id, :counter => 3
Expand Down

0 comments on commit b24e271

Please sign in to comment.