Commit 8eacccd8 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'ps-search-settings-add-helper' into 'master'

Add enable_search_settings_helper

See merge request gitlab-org/gitlab!53074
parents eee85cb3 a1873ad2
# 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 @@ ...@@ -24,4 +24,5 @@
%div{ class: "#{(container_class unless @no_container)} #{@content_class}" } %div{ class: "#{(container_class unless @no_container)} #{@content_class}" }
%main.content{ id: "content-body", **page_itemtype } %main.content{ id: "content-body", **page_itemtype }
= render "layouts/flash", extra_flash_class: 'limit-container-width' = render "layouts/flash", extra_flash_class: 'limit-container-width'
= yield :before_content
= yield = yield
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
- @content_class = "limit-container-width" unless fluid_layout - @content_class = "limit-container-width" unless fluid_layout
- expanded = expanded_by_default? - expanded = expanded_by_default?
= render "shared/search_settings" - enable_search_settings
%section.settings.general-settings.no-animate.expanded#js-general-settings %section.settings.general-settings.no-animate.expanded#js-general-settings
.settings-header .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