Commit 2ff377f489b2b6b9d9c24b03a217a880fd43731a
1 parent
e698ec68
Exists in
master
and in
29 other branches
ActionItem370: allow to add image with alignment in TinyMceArticle
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1936 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
15 additions
and
2 deletions
Show diff stats
config/environment.rb
... | ... | @@ -53,6 +53,9 @@ Rails::Initializer.run do |config| |
53 | 53 | :session_key => '_noosfero_session', |
54 | 54 | :secret => '7372009258e02886ca36278257637a008959504400f6286cd09133f6e9131d23460dd77e289bf99b480a3b4d017be0578b59335ce6a1c74e3644e37514926009' |
55 | 55 | } |
56 | + | |
57 | + # Adds custom attributes to the Set of allowed html attributes for the #sanitize helper | |
58 | + config.action_view.sanitized_allowed_attributes = 'align' | |
56 | 59 | |
57 | 60 | # See Rails::Configuration for more options |
58 | 61 | ... | ... |
test/functional/cms_controller_test.rb
... | ... | @@ -150,8 +150,6 @@ class CmsControllerTest < Test::Unit::TestCase |
150 | 150 | end |
151 | 151 | end |
152 | 152 | |
153 | - should 'display' | |
154 | - | |
155 | 153 | should 'be able to create a RSS feed' do |
156 | 154 | login_as(profile.identifier) |
157 | 155 | assert_difference RssFeed, :count do |
... | ... | @@ -429,4 +427,16 @@ class CmsControllerTest < Test::Unit::TestCase |
429 | 427 | assert_no_tag :tag => 'input', :attributes => { :type => 'checkbox', :name => 'article[published]', :checked => 'checked' } |
430 | 428 | end |
431 | 429 | |
430 | + should 'be able to add image with alignment' do | |
431 | + post :new, :type => 'TinyMceArticle', :profile => profile.identifier, :article => { :name => 'image-alignment', :body => "the text of the article with image <img src='#' align='right'/> right align..." } | |
432 | + saved = TinyMceArticle.find_by_name('image-alignment') | |
433 | + assert_match /<img src="#" align="right" \/>/, saved.body | |
434 | + end | |
435 | + | |
436 | + should 'not be able to add image with alignment when textile' do | |
437 | + post :new, :type => 'TextileArticle', :profile => profile.identifier, :article => { :name => 'image-alignment', :body => "the text of the article with image <img src='#' align='right'/> right align..." } | |
438 | + saved = TextileArticle.find_by_name('image-alignment') | |
439 | + assert_no_match /align="right"/, saved.body | |
440 | + end | |
441 | + | |
432 | 442 | end | ... | ... |