Commit a1873ad2 authored by Paul Slaughter's avatar Paul Slaughter Committed by Bob Van Landuyt

Add enable_search_settings_helper

parent 01a8bb6f
# frozen_string_literal: true
module EnableSearchSettingsHelper
def enable_search_settings(locals: {})
content_for :before_content do
render "shared/search_settings", locals
end
end
end
......@@ -24,4 +24,5 @@
%div{ class: "#{(container_class unless @no_container)} #{@content_class}" }
%main.content{ id: "content-body", **page_itemtype }
= render "layouts/flash", extra_flash_class: 'limit-container-width'
= yield :before_content
= yield
......@@ -3,7 +3,7 @@
- @content_class = "limit-container-width" unless fluid_layout
- expanded = expanded_by_default?
= render "shared/search_settings"
- enable_search_settings
%section.settings.general-settings.no-animate.expanded#js-general-settings
.settings-header
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe EnableSearchSettingsHelper do
describe '#enable_search_settings' do
def before_content
helper.content_for(:before_content)
end
it 'sets content for before_content' do
expect(before_content).to be_nil
locals = { container_class: 'test-container-class' }
helper.enable_search_settings(locals: locals)
expect(before_content).to eql(helper.render("shared/search_settings", locals))
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment