summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhukl <contact@smyck.org>2009-03-10 23:51:03 +0100
committerhukl <contact@smyck.org>2009-03-10 23:51:03 +0100
commitc9fa047402fdc009319dca7b05455e8ce73eaee7 (patch)
tree232bcb793cb187a50ec38343f8f93a3901492c2f /test
parentd987886a9a94c6bad53ff7c7a241b85ea0b57de7 (diff)
remove event resource temporarily until its finalized
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/events.yml7
-rw-r--r--test/functional/events_controller_test.rb45
-rw-r--r--test/unit/event_test.rb77
-rw-r--r--test/unit/helpers/events_helper_test.rb4
4 files changed, 0 insertions, 133 deletions
diff --git a/test/fixtures/events.yml b/test/fixtures/events.yml
deleted file mode 100644
index 6d43f1d..0000000
--- a/test/fixtures/events.yml
+++ /dev/null
@@ -1,7 +0,0 @@
1# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
3one:
4 serialized_event: MyText
5
6two:
7 serialized_event: MyText
diff --git a/test/functional/events_controller_test.rb b/test/functional/events_controller_test.rb
deleted file mode 100644
index 24a6f94..0000000
--- a/test/functional/events_controller_test.rb
+++ /dev/null
@@ -1,45 +0,0 @@
1require 'test_helper'
2
3class EventsControllerTest < ActionController::TestCase
4 test "should get index" do
5 get :index
6 assert_response :success
7 assert_not_nil assigns(:events)
8 end
9
10 test "should get new" do
11 get :new
12 assert_response :success
13 end
14
15 test "should create event" do
16 assert_difference('Event.count') do
17 post :create, :event => { }
18 end
19
20 assert_redirected_to event_path(assigns(:event))
21 end
22
23 test "should show event" do
24 get :show, :id => events(:one).id
25 assert_response :success
26 end
27
28 test "should get edit" do
29 get :edit, :id => events(:one).id
30 assert_response :success
31 end
32
33 test "should update event" do
34 put :update, :id => events(:one).id, :event => { }
35 assert_redirected_to event_path(assigns(:event))
36 end
37
38 test "should destroy event" do
39 assert_difference('Event.count', -1) do
40 delete :destroy, :id => events(:one).id
41 end
42
43 assert_redirected_to events_path
44 end
45end
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 @@
1require 'test_helper'
2
3class EventTest < ActiveSupport::TestCase
4
5 def setup
6 @cal = <<-EOT
7BEGIN:VCALENDAR
8VERSION:2.0
9PRODID:-//Ensemble Independent//vPim 0.658//EN
10CALSCALE:Gregorian
11BEGIN:VEVENT
12SUMMARY:Chaosradio
13DTSTART:20080505T220000
14LOCATION:FM 102,60 MHz
15URL:http://www.fritz.de/frequenzen
16RRULE:FREQ=MONTHLY;BYMONTH=1,2,3,4,5,6,7,8,9,10,11;BYDAY=-1WE;UNTIL=20091105T220000
17CREATED:20021020T220000
18DURATION:PT3H
19END:VEVENT
20END:VCALENDAR
21 EOT
22
23 @first_child = Node.find(2)
24 end
25
26 test 'saving serialized event' do
27 assert event = Event.create!( :serialized_event => @cal )
28 end
29
30 test 'parsing calendar data' do
31 event = Event.create!( :serialized_event => @cal )
32 assert calendar = ChaosCalendar.new
33 assert calendar.push( event.serialized_event, @first_child.id )
34 assert_equal 1, calendar.calendar.length
35 assert_equal "Chaosradio", calendar.calendar.to_a.first.first.summary
36 end
37
38 test 'checking occurrences logic' do
39 event = Event.create!( :serialized_event => @cal )
40 calendar = ChaosCalendar.new
41 calendar.push( event.serialized_event, @first_child.id )
42
43 all_occurrences = calendar.occurrences( "2009-03-22".to_datetime, "2010-01-10".to_datetime )
44 assert_equal 8, all_occurrences.length
45
46 assert_equal "2009-03-25".to_date, all_occurrences.first.dtstart.to_date
47 assert_equal "2009-10-28".to_date, all_occurrences.last.dtstart.to_date
48 end
49
50end
51
52__END__
53
54opt_days = 7
55
56calendar = ChaosCalendar.new
57
58
59calendar.push( cal, 25 )
60t0 = Time.today
61t1 = t0 + opt_days.days
62
63all_occurrences = calendar.occurrences( t0, t1 )
64
65all_occurrences.each do |o|
66 e = o.event
67 puts o.dtstart
68 puts "#{e.summary}:"
69
70 puts " description=#{e.description}" if e.description
71 puts " comment=#{e.comments.first}" if e.comments
72 puts " location=#{e.location}" if e.location
73 puts " status=#{e.status}" if e.status
74 puts " dtstart=#{e.dtstart}" if e.dtstart
75 puts " duration=#{Vpim::Duration.new(e.duration).to_s}" if e.duration
76end
77
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 @@
1require 'test_helper'
2
3class EventsHelperTest < ActionView::TestCase
4end