Commit 66eb5163047b9da097b46e807406f73a2c31712c

Authored by Simiao Carvalho
Committed by Tallys Martins
1 parent 92476194

New topics now accepts reply by default

Signed-off-by: Brenddon Gontijo <brenddongontijo@msn.com>
Signed-off-by: Eduardo Vital <vitaldu@gmail.com>
Signed-off-by: Jessica Cristina <jessica.cris1127@gmail.com>
Signed-off-by: Simiao Carvalho <simiaosimis@gmail.com>
Signed-off-by: Tallys Martins <tallysmartins@gmail.com>
app/helpers/article_helper.rb
... ... @@ -23,13 +23,11 @@ module ArticleHelper
23 23 ) :
24 24 '') +
25 25  
26   - (article.parent && article.parent.forum? && controller.action_name == 'new' ?
27   - hidden_field_tag('article[accept_comments]', 1) :
28 26 content_tag(
29 27 'div',
30 28 check_box(:article, :accept_comments) +
31 29 content_tag('label', (article.parent && article.parent.forum? ? _('This topic is opened for replies') : _('I want to receive comments about this article')), :for => 'article_accept_comments')
32   - )) +
  30 + ) +
33 31  
34 32 content_tag(
35 33 'div',
... ...
test/functional/cms_controller_test.rb
... ... @@ -1601,11 +1601,11 @@ class CmsControllerTest &lt; ActionController::TestCase
1601 1601 assert_no_tag :tag => 'input', :attributes => { :type => 'checkbox', :name => 'article[display_posts_in_current_language]', :checked => 'checked' }
1602 1602 end
1603 1603  
1604   - should 'not display accept comments option when creating forum post' do
  1604 + should 'display accept comments option when creating forum post' do
1605 1605 profile.articles << f = Forum.new(:name => 'Forum for test')
1606 1606 get :new, :profile => profile.identifier, :type => 'TinyMceArticle', :parent_id => f.id
1607   - assert :tag => 'input', :attributes => {:name => 'article[accept_comments]', :value => 1, :type => 'hidden'}
1608   - assert_no_tag :tag => 'input', :attributes => {:name => 'article[accept_comments]', :value => 1, :type => 'checkbox'}
  1607 + assert_no_tag :tag => 'input', :attributes => {:name => 'article[accept_comments]', :value => 1, :type => 'hidden'}
  1608 + assert_tag :tag => 'input', :attributes => {:name => 'article[accept_comments]', :value => 1, :type => 'checkbox'}
1609 1609 end
1610 1610  
1611 1611 should 'display accept comments option when creating an article that is not a forum post' do
... ...