From 21f575af3aba871db769c177556c029451ad3d25 Mon Sep 17 00:00:00 2001 From: Matt Simpson Date: Sat, 28 Dec 2013 19:43:59 -0600 Subject: [PATCH] Specify the full path to the NEWLINE constant --- .../features/helpers_select_tag.feature | 19 +++++++++++++++++++ .../core_extensions/default_helpers.rb | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 middleman-core/features/helpers_select_tag.feature diff --git a/middleman-core/features/helpers_select_tag.feature b/middleman-core/features/helpers_select_tag.feature new file mode 100644 index 00000000..803f72e4 --- /dev/null +++ b/middleman-core/features/helpers_select_tag.feature @@ -0,0 +1,19 @@ +Feature: select_tag helper + + Scenario: select_tag produces correct options + Given a fixture app "indexable-app" + And an empty file named "config.rb" + And a file named "source/select_tag.html.erb" with: + """ + options as array: <%= select_tag :colors, options: ["red", "blue", "blorange"], include_blank: "Choose a color" %> + """ + And the Server is running at "indexable-app" + When I go to "/select_tag.html" + Then I should see: + """ + + """ diff --git a/middleman-core/lib/middleman-more/core_extensions/default_helpers.rb b/middleman-core/lib/middleman-more/core_extensions/default_helpers.rb index 25eae484..704325eb 100644 --- a/middleman-core/lib/middleman-more/core_extensions/default_helpers.rb +++ b/middleman-core/lib/middleman-more/core_extensions/default_helpers.rb @@ -49,7 +49,7 @@ class Middleman::CoreExtensions::DefaultHelpers < ::Middleman::Extension output = ActiveSupport::SafeBuffer.new output.safe_concat "<#{name}#{attributes}>" if content.respond_to?(:each) && !content.is_a?(String) - content.each { |c| output.safe_concat c; output.safe_concat NEWLINE } + content.each { |c| output.safe_concat c; output.safe_concat ::Padrino::Helpers::TagHelpers::NEWLINE } else output.safe_concat "#{content}" end