Commit 86993704 authored by Zac Wood's avatar Zac Wood

updated schedules test

parent 899bf4a4
......@@ -5,7 +5,7 @@ require 'time'
class Schedule
def initialize(ids)
@cal = Icalendar::Calendar.new
@cal.x_wr_calname = 'GMU Fall 2018'
@cal.x_wr_calname = 'GMU Schedule'
@course_sections = ids.map { |id| CourseSection.find_by_id id }
@course_sections.compact!
......
......@@ -13,7 +13,7 @@ Rails.application.routes.draw do
resources :course_sections, only: [:index], as: 'api_course_sections'
resources :instructors, only: [:index, :show], as: 'api_instructors'
resources :course_listings, only: [:index]
resources :schedules, only: [:index]
resources :schedules, only: [:index], as: 'api_schedules'
end
apipie # sets up API docs
......
......@@ -3,7 +3,8 @@ require 'test_helper'
class API::SchedulesControllerTest < ActionDispatch::IntegrationTest
test "should generate schedule" do
ids = [course_sections(:cs112001).id, course_sections(:cs112002).id]
get "/api/schedules?section_ids=#{ids.join(',')}&semester_id=#{semesters(:fall2018).id}"
get api_schedules_path section_ids: ids.join(','), semester_id: semesters(:fall2018).id
# DTSTAMP and UID lines uniquely identify events, so we can't test against them.
# so remove all the lines starting with them.
......
......@@ -2,7 +2,7 @@ BEGIN:VCALENDAR
VERSION:2.0
PRODID:icalendar-ruby
CALSCALE:GREGORIAN
X-WR-CALNAME:GMU Fall 2018
X-WR-CALNAME:GMU Schedule
BEGIN:VEVENT
DTSTART:20180521T120000
DTEND:20180521T130000
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment