Move strip_html to main app, fixes context-sensitive chili feature spec fail

This commit is contained in:
Rohan Mitchell
2013-07-22 16:21:32 +10:00
parent d9988dac09
commit 2ddc5b4e4a
3 changed files with 4 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
module FeatureHelper
module HtmlHelper
def strip_html(html)
strip_tags(html).gsub(/ /i, ' ').gsub(/&/i, '&')
end

View File

@@ -0,0 +1,3 @@
Spree::OrderMailer.class_eval do
helper HtmlHelper
end

View File

@@ -7,8 +7,6 @@ module EnterprisesDistributorInfoRichTextFeature
initializer 'enterprises_distributor_info_rich_text_feature.mailer', :after => :load_config_initializers do |app|
if OpenFoodWeb::FeatureToggle.enabled? :enterprises_distributor_info_rich_text
::Spree::OrderMailer.class_eval do
helper FeatureHelper
def confirm_email(order, resend = false)
@order = order
subject = (resend ? "[#{t(:resend).upcase}] " : '')