From c9fa047402fdc009319dca7b05455e8ce73eaee7 Mon Sep 17 00:00:00 2001 From: hukl Date: Tue, 10 Mar 2009 23:51:03 +0100 Subject: remove event resource temporarily until its finalized --- test/unit/event_test.rb | 77 --------------------------------- test/unit/helpers/events_helper_test.rb | 4 -- 2 files changed, 81 deletions(-) delete mode 100644 test/unit/event_test.rb delete mode 100644 test/unit/helpers/events_helper_test.rb (limited to 'test/unit') diff --git a/test/unit/event_test.rb b/test/unit/event_test.rb deleted file mode 100644 index c8ee335..0000000 --- a/test/unit/event_test.rb +++ /dev/null @@ -1,77 +0,0 @@ -require 'test_helper' - -class EventTest < ActiveSupport::TestCase - - def setup - @cal = <<-EOT -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Ensemble Independent//vPim 0.658//EN -CALSCALE:Gregorian -BEGIN:VEVENT -SUMMARY:Chaosradio -DTSTART:20080505T220000 -LOCATION:FM 102,60 MHz -URL:http://www.fritz.de/frequenzen -RRULE:FREQ=MONTHLY;BYMONTH=1,2,3,4,5,6,7,8,9,10,11;BYDAY=-1WE;UNTIL=20091105T220000 -CREATED:20021020T220000 -DURATION:PT3H -END:VEVENT -END:VCALENDAR - EOT - - @first_child = Node.find(2) - end - - test 'saving serialized event' do - assert event = Event.create!( :serialized_event => @cal ) - end - - test 'parsing calendar data' do - event = Event.create!( :serialized_event => @cal ) - assert calendar = ChaosCalendar.new - assert calendar.push( event.serialized_event, @first_child.id ) - assert_equal 1, calendar.calendar.length - assert_equal "Chaosradio", calendar.calendar.to_a.first.first.summary - end - - test 'checking occurrences logic' do - event = Event.create!( :serialized_event => @cal ) - calendar = ChaosCalendar.new - calendar.push( event.serialized_event, @first_child.id ) - - all_occurrences = calendar.occurrences( "2009-03-22".to_datetime, "2010-01-10".to_datetime ) - assert_equal 8, all_occurrences.length - - assert_equal "2009-03-25".to_date, all_occurrences.first.dtstart.to_date - assert_equal "2009-10-28".to_date, all_occurrences.last.dtstart.to_date - end - -end - -__END__ - -opt_days = 7 - -calendar = ChaosCalendar.new - - -calendar.push( cal, 25 ) -t0 = Time.today -t1 = t0 + opt_days.days - -all_occurrences = calendar.occurrences( t0, t1 ) - -all_occurrences.each do |o| - e = o.event - puts o.dtstart - puts "#{e.summary}:" - - puts " description=#{e.description}" if e.description - puts " comment=#{e.comments.first}" if e.comments - puts " location=#{e.location}" if e.location - puts " status=#{e.status}" if e.status - puts " dtstart=#{e.dtstart}" if e.dtstart - puts " duration=#{Vpim::Duration.new(e.duration).to_s}" if e.duration -end - diff --git a/test/unit/helpers/events_helper_test.rb b/test/unit/helpers/events_helper_test.rb deleted file mode 100644 index 2e7567e..0000000 --- a/test/unit/helpers/events_helper_test.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'test_helper' - -class EventsHelperTest < ActionView::TestCase -end -- cgit v1.3