Skip to content

Commit

Permalink
Add bookmarks and search history nav actions to catalog controller te…
Browse files Browse the repository at this point in the history
…mplate
  • Loading branch information
eliotjordan committed Jul 26, 2018
1 parent 9d79a06 commit 9d0dd2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/generators/geoblacklight/templates/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ class CatalogController < ApplicationController
# mean") suggestion is offered.
config.spell_max = 5

# Nav actions from Blacklight
config.add_nav_action(:bookmark, partial: 'blacklight/nav/bookmark', if: :render_bookmarks_control?)
config.add_nav_action(:search_history, partial: 'blacklight/nav/search_history')

# Tools from Blacklight
config.add_show_tools_partial(:bookmark, partial: 'bookmark_control', if: :render_bookmarks_control?)
config.add_show_tools_partial(:email, callback: :email_action, validator: :validate_email_params)
Expand Down
4 changes: 4 additions & 0 deletions spec/features/home_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
before do
visit root_path
end
scenario 'navbar' do
expect(page).to have_css '#bookmarks_nav'
expect(page).to have_css 'a', text: 'History'
end
scenario 'search bar' do
expect(page).not_to have_css '#search-navbar'
within '.jumbotron' do
Expand Down

0 comments on commit 9d0dd2c

Please sign in to comment.