forked from sebbo2002/ical-generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add attendee status needs-action and attendee RSVP.
- Loading branch information
Showing
3 changed files
with
76 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1766,6 +1766,42 @@ describe('ical-generator 0.2.x / ICalCalendar', function() { | |
}); | ||
}); | ||
|
||
describe('rsvp()', function() { | ||
it('setter should return this', function() { | ||
var a = ical().createEvent().createAttendee(); | ||
assert.deepEqual(a, a.rsvp(null)); | ||
assert.deepEqual(a, a.rsvp('TRUE')); | ||
}); | ||
|
||
it('getter should return value', function() { | ||
var a = ical().createEvent().createAttendee(); | ||
assert.equal(a.rsvp(), null); | ||
a.rsvp('false'); | ||
assert.equal(a.rsvp(), 'FALSE'); | ||
a.rsvp(null); | ||
assert.equal(a.rsvp(), null); | ||
}); | ||
|
||
it('should throw error when method not allowed', function() { | ||
var a = ical().createEvent().createAttendee(); | ||
assert.throws(function() { | ||
a.rsvp('PROBABLY'); | ||
}, /`rsvp` must be one of the following/); | ||
}); | ||
|
||
it('should change something', function() { | ||
var cal = ical(), | ||
event = cal.createEvent({ | ||
start: new Date(), | ||
end: new Date(new Date().getTime() + 3600000), | ||
summary: 'Example Event' | ||
}); | ||
|
||
event.createAttendee({email: '[email protected]', rsvp: 'true'}); | ||
assert.ok(cal.toString().indexOf(';RSVP=TRUE') > -1); | ||
}); | ||
}); | ||
|
||
describe('status()', function() { | ||
it('setter should return this', function() { | ||
var a = ical().createEvent().createAttendee(); | ||
|