Commit 5b9b6c8f467daa30db79447b40785bdbf7308022
1 parent
3f54dc4f
Exists in
master
and in
22 other branches
New kind of article RawHTMLArticle
(ActionItem2056)
Showing
5 changed files
with
47 additions
and
0 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
test/functional/cms_controller_test.rb
| ... | ... | @@ -1618,4 +1618,11 @@ class CmsControllerTest < Test::Unit::TestCase |
| 1618 | 1618 | end |
| 1619 | 1619 | end |
| 1620 | 1620 | |
| 1621 | + should 'make RawHTMLArticle available only to environment admins' do | |
| 1622 | + @controller.stubs(:profile).returns(profile) | |
| 1623 | + assert_not_includes @controller.available_article_types, RawHTMLArticle | |
| 1624 | + profile.environment.add_admin(profile) | |
| 1625 | + assert_includes @controller.available_article_types, RawHTMLArticle | |
| 1626 | + end | |
| 1627 | + | |
| 1621 | 1628 | end | ... | ... |
| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | +require File.dirname(__FILE__) + '/../test_helper' | |
| 2 | + | |
| 3 | +class RawHTMLArticleTest < ActiveSupport::TestCase | |
| 4 | + | |
| 5 | + def setup | |
| 6 | + @profile = create_user('testing').person | |
| 7 | + end | |
| 8 | + | |
| 9 | + should 'not filter HTML' do | |
| 10 | + article = RawHTMLArticle.create!( | |
| 11 | + :name => 'Raw HTML', | |
| 12 | + :body => '<strong>HTML!</strong><form action="#"></form>', | |
| 13 | + :profile => @profile | |
| 14 | + ) | |
| 15 | + assert_equal '<strong>HTML!</strong><form action="#"></form>', article.body | |
| 16 | + end | |
| 17 | + | |
| 18 | +end | ... | ... |