diff --git a/app/models/event.rb b/app/models/event.rb index bf64a65..59472c1 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -96,6 +96,7 @@ class Event < Article protected def maybe_add_http(value) + return unless value if value =~ /https?:\/\// value else diff --git a/test/functional/cms_controller_test.rb b/test/functional/cms_controller_test.rb index 65fc82c..07a1e11 100644 --- a/test/functional/cms_controller_test.rb +++ b/test/functional/cms_controller_test.rb @@ -467,12 +467,7 @@ class CmsControllerTest < Test::Unit::TestCase should 'be able to create a new event document' do get :new, :type => 'Event', :profile => profile.identifier assert_response :success - #assert_template 'select_article_type' - - ## TODO add more types here !! - #[ TinyMceArticle, TextileArticle ].each do |item| - # assert_tag :tag => 'a', :attributes => { :href => "/myprofile/#{profile.identifier}/cms/new?type=#{item.name}" } - #end + assert_tag :input, :attributes => { :id => 'article_link' } end end diff --git a/test/unit/event_test.rb b/test/unit/event_test.rb index 58e99e8..ff13929 100644 --- a/test/unit/event_test.rb +++ b/test/unit/event_test.rb @@ -163,4 +163,11 @@ class EventTest < ActiveSupport::TestCase assert_no_tag_in_string e.description, :tag => 'script' end + should 'nil to link' do + e = Event.new + assert_nothing_raised TypeError do + e.link = nil + end + end + end -- libgit2 0.21.2