Commit 8f09db6ac1ffd8a4c17e7da977f9190832e13309

Authored by Rodrigo Souto
Committed by Antonio Terceiro
1 parent 5a94fec6

Event type is always available

app/controllers/my_profile/cms_controller.rb
@@ -40,9 +40,9 @@ class CmsController < MyProfileController @@ -40,9 +40,9 @@ class CmsController < MyProfileController
40 def available_article_types 40 def available_article_types
41 articles = [ 41 articles = [
42 TinyMceArticle, 42 TinyMceArticle,
43 - TextileArticle 43 + TextileArticle,
  44 + Event
44 ] 45 ]
45 - articles << Event unless profile.environment.enabled?(:disable_asset_events)  
46 parent_id = params ? params[:parent_id] : nil 46 parent_id = params ? params[:parent_id] : nil
47 if !parent_id or !Article.find(parent_id).blog? 47 if !parent_id or !Article.find(parent_id).blog?
48 articles += [ 48 articles += [
test/functional/cms_controller_test.rb
@@ -1155,17 +1155,6 @@ class CmsControllerTest &lt; Test::Unit::TestCase @@ -1155,17 +1155,6 @@ class CmsControllerTest &lt; Test::Unit::TestCase
1155 assert_no_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/upload_files?parent_id=#{profile.blog.id}"} 1155 assert_no_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/upload_files?parent_id=#{profile.blog.id}"}
1156 end 1156 end
1157 1157
1158 - should 'not offer to create events if events is disabled' do  
1159 - e = profile.environment  
1160 - e.enable(:disable_asset_events)  
1161 - e.save!  
1162 -  
1163 - get :new, :profile => profile.identifier  
1164 -  
1165 -  
1166 - assert_not_includes assigns(:article_types).map{|at|at[:name]}, 'Event'  
1167 - end  
1168 -  
1169 should 'not allow user without permission create an article in community' do 1158 should 'not allow user without permission create an article in community' do
1170 c = Community.create!(:name => 'test_comm', :identifier => 'test_comm') 1159 c = Community.create!(:name => 'test_comm', :identifier => 'test_comm')
1171 u = create_user_with_permission('test_user', 'bogus_permission', c) 1160 u = create_user_with_permission('test_user', 'bogus_permission', c)