diff --git a/test/unit/tiny_mce_article_test.rb b/test/unit/tiny_mce_article_test.rb
index 4b92552..e7433a9 100644
--- a/test/unit/tiny_mce_article_test.rb
+++ b/test/unit/tiny_mce_article_test.rb
@@ -23,52 +23,52 @@ class TinyMceArticleTest < ActiveSupport::TestCase
end
should 'not sanitize target attribute' do
- article = TinyMceArticle.create!(:name => 'open link in new window', :body => "open link in new window", :profile => profile)
+ article = create(TinyMceArticle, :name => 'open link in new window', :body => "open link in new window", :profile => profile)
assert_tag_in_string article.body, :tag => 'a', :attributes => {:target => '_blank'}
end
should 'not translate & to amp; over times' do
- article = TinyMceArticle.create!(:name => 'link', :body => "link", :profile => profile)
+ article = create(TinyMceArticle, :name => 'link', :body => "link", :profile => profile)
assert article.save
assert_no_match(/&/, article.body)
assert_match(/&/, article.body)
end
should 'not escape comments from tiny mce article body' do
- article = TinyMceArticle.create!(:profile => profile, :name => 'article', :abstract => 'abstract', :body => "the article ...")
+ article = create(TinyMceArticle, :profile => profile, :name => 'article', :abstract => 'abstract', :body => "the article ...")
assert_equal "the article ...", article.body
end
should 'convert entities characters to UTF-8 instead of ISO-8859-1' do
- article = TinyMceArticle.create!(:profile => profile, :name => 'teste ' + Time.now.to_s, :body => 'link')
+ article = create(TinyMceArticle, :profile => profile, :name => 'teste ' + Time.now.to_s, :body => 'link')
assert(article.body.is_utf8?, "%s expected to be valid UTF-8 content" % article.body.inspect)
end
should 'fix tinymce mess with itheora comments for IE from tiny mce article body' do
- article = TinyMceArticle.create!(:profile => profile, :name => 'article', :abstract => 'abstract', :body => "the just for ie... ")
- assert_equal "the just for ie... ", article.body
+ article = create(TinyMceArticle, :profile => profile, :name => 'article', :abstract => 'abstract', :body => "the just for ie... ")
+ assert_equal "the just for ie... ", article.body.html_safe
end
should 'remove iframe if it is not from a trusted site' do
- article = TinyMceArticle.create!(:profile => profile, :name => 'article', :abstract => 'abstract', :body => "")
+ article = create(TinyMceArticle, :profile => profile, :name => 'article', :abstract => 'abstract', :body => "")
assert_equal "", article.body
end
should 'not mess with