Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
schedules
Commits
86993704
Commit
86993704
authored
Nov 09, 2018
by
Zac Wood
Browse files
updated schedules test
parent
899bf4a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
schedules/app/models/schedule.rb
View file @
86993704
...
...
@@ -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!
...
...
schedules/config/routes.rb
View file @
86993704
...
...
@@ -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
...
...
schedules/test/controllers/api/schedules_controller_test.rb
View file @
86993704
...
...
@@ -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.
...
...
schedules/test/test.ics
View file @
86993704
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment