I'm submitting a…
Current behavior
Both of the iCalendar routes are unusable:
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.
I'm submitting a…
Current behavior
Both of the iCalendar routes are unusable:
/conferences/…/schedule.icsraisesNoMethodError: undefined method 'icalendar_proposals'./calendar.icsredirects to/without explanation.Expected correct behavior
Both endpoints should return iCalendar data.
Steps to reproduce
Minimal tests
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.