Skip to content

iCalendar routes are unusable #3261

@AndrewKvalheim

Description

@AndrewKvalheim

I'm submitting a…

  • Bug Report
  • Feature Request

Current behavior

Both of the iCalendar routes are unusable:

  • /conferences/…/schedule.ics raises NoMethodError: undefined method 'icalendar_proposals'.

  • /calendar.ics redirects to / without explanation.

Expected correct behavior

Both endpoints should return iCalendar data.

Steps to reproduce

Minimal tests
--- a/spec/controllers/schedules_controller_spec.rb
+++ b/spec/controllers/schedules_controller_spec.rb
@@ -8,9 +8,20 @@ describe SchedulesController do
   describe 'GET #show' do
+    before :each do
+      conference.program.update_attribute(:schedule_public, true)
+      create_pair(:event_scheduled, program: conference.program)
+    end
+
+    context 'iCalendar' do
+      before :each do
+        get :show, params: { conference_id: conference.short_title, format: :ics }
+      end
+
+      it 'returns iCalendar data' do
+        expect(response.content_type).to start_with('text/calendar')
+        expect(response.body).to start_with('BEGIN:VCALENDAR')
+      end
+    end
+
     context 'XML' do
       before :each do
-        conference.program.schedule_public = true
-        conference.program.save!
-        create(:event_scheduled, program: conference.program)
-        create(:event_scheduled, program: conference.program)
-
         get :show, params: { conference_id: conference.short_title, format: :xml }
--- a/spec/controllers/conferences_controller_spec.rb
+++ b/spec/controllers/conferences_controller_spec.rb
@@ -51,2 +51,10 @@ describe ConferencesController do
 
+  describe 'GET #calendar' do
+    it 'returns iCalendar data' do
+      get :calendar, params: { format: :ics, full: true }
+
+      expect(response.content_type).to start_with('text/calendar')
+      expect(response.body).to start_with('BEGIN:VCALENDAR')
+    end
+  end
 end

Other information

#2717 added this feature without tests, so it’s not clear that it ever worked. #2977 apparently attempted a solution but didn’t address CanCanCan abilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is wrong and needs to be fixed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions