Commit e9e5d31df4096abb8b4129ccd4f5466edf0c90c8
1 parent
498b3078
Exists in
staging
and in
31 other branches
html_safe: not escape tinymce macros
Showing
2 changed files
with
18 additions
and
1 deletions
Show diff stats
app/helpers/macros_helper.rb
test/integration/safe_strings_test.rb
@@ -100,4 +100,21 @@ class SafeStringsTest < ActionDispatch::IntegrationTest | @@ -100,4 +100,21 @@ class SafeStringsTest < ActionDispatch::IntegrationTest | ||
100 | get url_for(article.view_url) | 100 | get url_for(article.view_url) |
101 | assert_select ".publishing-info .author a" | 101 | assert_select ".publishing-info .author a" |
102 | end | 102 | end |
103 | + | ||
104 | + should 'not escape tinymce macros when create article' do | ||
105 | + class Plugin1 < Noosfero::Plugin | ||
106 | + end | ||
107 | + class Plugin1::Macro < Noosfero::Plugin::Macro | ||
108 | + def self.configuration | ||
109 | + {params: {}} | ||
110 | + end | ||
111 | + end | ||
112 | + Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([SafeStringsTest::Plugin1.new]) | ||
113 | + | ||
114 | + create_user('jimi', :password => 'test', :password_confirmation => 'test').activate | ||
115 | + person = Person['jimi'] | ||
116 | + login 'jimi', 'test' | ||
117 | + get "/myprofile/jimi/cms/new?type=TinyMceArticle" | ||
118 | + assert_no_match /title: "Safestringstest::plugin1::macro"/, response.body | ||
119 | + end | ||
103 | end | 120 | end |