Commit 2011e00c3141fe1eefa8b28979c006998072ad79

Authored by JoenioCosta
1 parent 58911d1d

ActionItem484: fixing create new event


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2090 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/event.rb
@@ -96,6 +96,7 @@ class Event < Article @@ -96,6 +96,7 @@ class Event < Article
96 protected 96 protected
97 97
98 def maybe_add_http(value) 98 def maybe_add_http(value)
  99 + return unless value
99 if value =~ /https?:\/\// 100 if value =~ /https?:\/\//
100 value 101 value
101 else 102 else
test/functional/cms_controller_test.rb
@@ -467,12 +467,7 @@ class CmsControllerTest < Test::Unit::TestCase @@ -467,12 +467,7 @@ class CmsControllerTest < Test::Unit::TestCase
467 should 'be able to create a new event document' do 467 should 'be able to create a new event document' do
468 get :new, :type => 'Event', :profile => profile.identifier 468 get :new, :type => 'Event', :profile => profile.identifier
469 assert_response :success 469 assert_response :success
470 - #assert_template 'select_article_type'  
471 -  
472 - ## TODO add more types here !!  
473 - #[ TinyMceArticle, TextileArticle ].each do |item|  
474 - # assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/new?type=#{item.name}" }  
475 - #end 470 + assert_tag :input, :attributes => { :id => 'article_link' }
476 end 471 end
477 472
478 end 473 end
test/unit/event_test.rb
@@ -163,4 +163,11 @@ class EventTest < ActiveSupport::TestCase @@ -163,4 +163,11 @@ class EventTest < ActiveSupport::TestCase
163 assert_no_tag_in_string e.description, :tag => 'script' 163 assert_no_tag_in_string e.description, :tag => 'script'
164 end 164 end
165 165
  166 + should 'nil to link' do
  167 + e = Event.new
  168 + assert_nothing_raised TypeError do
  169 + e.link = nil
  170 + end
  171 + end
  172 +
166 end 173 end