Commit 9731f6e8cc928a1e6165c49c530c7c78f43694c9
1 parent
14a816da
Exists in
master
and in
29 other branches
Disabling translation for forum posts
(ActionItem1817)
Showing
10 changed files
with
43 additions
and
25 deletions
Show diff stats
app/models/event.rb
app/models/text_article.rb
app/models/textile_article.rb
app/models/tiny_mce_article.rb
test/unit/event_test.rb
test/unit/text_article_test.rb
test/unit/textile_article_test.rb
... | ... | @@ -145,10 +145,4 @@ class TextileArticleTest < Test::Unit::TestCase |
145 | 145 | assert_equal false, a.advertise? |
146 | 146 | assert_equal false, a.is_trackable? |
147 | 147 | end |
148 | - | |
149 | - should 'be translatable' do | |
150 | - a = TextileArticle.new | |
151 | - assert a.translatable? | |
152 | - end | |
153 | - | |
154 | 148 | end | ... | ... |
test/unit/tiny_mce_article_test.rb
... | ... | @@ -236,9 +236,4 @@ class TinyMceArticleTest < Test::Unit::TestCase |
236 | 236 | assert_equal false, a.advertise? |
237 | 237 | assert_equal false, a.is_trackable? |
238 | 238 | end |
239 | - | |
240 | - should 'be translatable' do | |
241 | - a = TinyMceArticle.new | |
242 | - assert a.translatable? | |
243 | - end | |
244 | 239 | end | ... | ... |
... | ... | @@ -0,0 +1,29 @@ |
1 | +require File.dirname(__FILE__) + '/../test_helper' | |
2 | + | |
3 | +class TranslatableContentTest < ActiveSupport::TestCase | |
4 | + | |
5 | + class Content | |
6 | + attr_accessor :parent | |
7 | + include Noosfero::TranslatableContent | |
8 | + end | |
9 | + | |
10 | + def setup | |
11 | + @content = Content.new | |
12 | + end | |
13 | + attr_reader :content | |
14 | + | |
15 | + should 'be translatable if no parent' do | |
16 | + assert content.translatable? | |
17 | + end | |
18 | + | |
19 | + should 'not be translatable if parent is a forum' do | |
20 | + content.parent = Forum.new | |
21 | + assert !content.translatable? | |
22 | + end | |
23 | + | |
24 | + should 'be translatable if parent is not a forum' do | |
25 | + content.parent = Blog.new | |
26 | + assert content.translatable? | |
27 | + end | |
28 | + | |
29 | +end | ... | ... |