Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iCalendar routes are unusable #3261

Open
1 of 2 tasks
AndrewKvalheim opened this issue Nov 13, 2023 · 0 comments
Open
1 of 2 tasks

iCalendar routes are unusable #3261

AndrewKvalheim opened this issue Nov 13, 2023 · 0 comments

Comments

@AndrewKvalheim
Copy link
Member

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.

@AndrewKvalheim AndrewKvalheim changed the title iCalendar routes are unable iCalendar routes are unusable Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant